import type { OAuthClient } from '@supabase/supabase-js' import { toast } from 'sonner' import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, } from 'ui' import { Input } from 'ui-patterns/DataInputs/Input' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' interface NewOAuthAppModalProps { oauthApp: OAuthClient | undefined onClose: () => void } /** * Shows the credentials of a newly created OAuth app, or of an app whose secret was regenerated. * The client secret can't be retrieved again, so the modal can only be dismissed with "Done". */ export const NewOAuthAppModal = ({ oauthApp, onClose }: NewOAuthAppModalProps) => { const isOpen = !!oauthApp?.client_secret return ( e.preventDefault()} onEscapeKeyDown={(e) => e.preventDefault()} > Save your client secret Copy the client ID and secret for {oauthApp?.client_name} now. The secret won't be shown again. If you lose it, regenerate it from the app's settings. toast.success('Client ID copied to clipboard')} /> toast.success('Client secret copied to clipboard')} /> ) }