import { X } from 'lucide-react' import { toast } from 'sonner' import { Button } from 'ui' import { Admonition } from 'ui-patterns' import { Input } from 'ui-patterns/DataInputs/Input' import { useGroupedPermissions } from '../hooks/useGroupedPermissions' import { TokenPermissionsSection } from './TokenPermissionSection' interface AccessTokenNewBannerProps { token: T onClose: () => void getTokenValue: (token: T) => string getTokenPermissions?: (token: T) => string[] | undefined title?: string description?: string } export const AccessTokenNewBanner = ({ token, onClose, getTokenValue, getTokenPermissions, title = 'Successfully generated a new token!', description = 'Copy this access token and store it in a secure place. You will not be able to see it again.', }: AccessTokenNewBannerProps) => { const tokenPermissions = getTokenPermissions?.(token) const { groupedPermissions, totalCount } = useGroupedPermissions(tokenPermissions) return ( } className="w-7 h-7 absolute top-2.5 right-2.5" onClick={onClose} /> } >

{description}

{}} onCopy={() => toast.success('Token copied to clipboard')} />
{tokenPermissions && tokenPermissions.length > 0 && ( )}
) }