import { ComponentProps } from 'react' import { toast } from 'sonner' import { Button, DialogClose, DialogContent, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, } from 'ui' import { OAuthGrant } from '@/data/oauth-apps/oauth-apps-grants-query' import { useOAuthGrantRevokeMutation } from '@/data/oauth-apps/oauth-apps-revoke-grant-mutation' interface GrantDisconnectDialogContentProps extends ComponentProps { grant: OAuthGrant onClose: () => void } export const GrantDisconnectDialogContent = ({ grant, onClose, ...props }: GrantDisconnectDialogContentProps) => { const { mutate: revokeGrant, isPending } = useOAuthGrantRevokeMutation({ onSuccess: () => { toast.success(`Revoked access for ${grant?.attributes.app?.name}`) onClose() }, }) return ( Revoke access for {grant?.attributes.app?.name}

{grant?.attributes.app.name} will no longer be able to access your projects. To reconnect, authorize {grant?.attributes.app.name} again and reselect your projects.

Other organization members won't be affected.

) }