import { BoxIcon } from 'lucide-react' import { ComponentProps } from 'react' import { Button, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogSectionSeparator, DialogTitle, ScrollArea, } from 'ui' import { OAuthGrantAccordion, OAuthGrantAccordionItem, } from '@/components/interfaces/Organization/OAuthApps/OAuthGrantAccordionItem' import { OAuthGrant } from '@/data/oauth-apps/oauth-apps-grants-query' import { pluralize } from '@/lib/helpers' interface GrantProjectsDialogContentProps extends ComponentProps { grant: OAuthGrant } export const GrantProjectsDialogContent = ({ grant, ...props }: GrantProjectsDialogContentProps) => { return ( Projects using {grant?.attributes.app.name} My authorized projects using {grant?.attributes.app.name} {grant?.attributes.projects?.map((project) => { const permissionCount = grant.attributes.approved_scopes.length return ( } title={project.name} description={`${permissionCount} ${pluralize(permissionCount, 'permission')}`} sections={[{ label: 'Permissions', values: grant.attributes.approved_scopes }]} /> ) })} ) }