import type { OAuthClient } from '@supabase/supabase-js' import { useParams } from 'common' import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import { useProjectApiUrl } from '@/data/config/project-endpoint-query' import type { OAuthServerAppDeleteVariables } from '@/data/oauth-server-apps/oauth-server-app-delete-mutation' interface DeleteOAuthAppModalProps { visible: boolean selectedApp?: OAuthClient setVisible: (value: string | null) => void onDelete: (params: OAuthServerAppDeleteVariables) => void isLoading: boolean } export const DeleteOAuthAppModal = ({ visible, selectedApp, setVisible, onDelete, isLoading, }: DeleteOAuthAppModalProps) => { const { ref: projectRef } = useParams() const { hostEndpoint: clientEndpoint } = useProjectApiUrl({ projectRef }) const onConfirmDeleteApp = () => { onDelete({ projectRef, clientEndpoint, clientId: selectedApp?.client_id, }) } return ( Confirm to delete OAuth app{' '} {selectedApp?.client_name} } confirmLabel="Confirm delete" confirmLabelLoading="Deleting..." onCancel={() => setVisible(null)} onConfirm={() => onConfirmDeleteApp()} alert={{ title: 'This action cannot be undone', description: 'You will need to re-create the OAuth app if you want to revert the deletion.', }} >

Before deleting this OAuth app, consider:

) }