mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 23:24:21 +08:00
* Reinstate copy action for TextConfirmModal for staff only * Clean --------- Co-authored-by: Ali Waseem <waseema393@gmail.com>
34 lines
888 B
TypeScript
34 lines
888 B
TypeScript
import { TextConfirmModal } from 'components/ui/TextConfirmModalWrapper'
|
|
|
|
interface DeleteDestinationProps {
|
|
visible: boolean
|
|
isLoading: boolean
|
|
name: string
|
|
setVisible: (value: boolean) => void
|
|
onDelete: () => void
|
|
}
|
|
|
|
export const DeleteDestination = ({
|
|
visible,
|
|
isLoading,
|
|
name,
|
|
setVisible,
|
|
onDelete,
|
|
}: DeleteDestinationProps) => {
|
|
return (
|
|
<TextConfirmModal
|
|
variant="destructive"
|
|
visible={visible}
|
|
loading={isLoading}
|
|
title="Delete this destination"
|
|
confirmLabel={isLoading ? 'Deleting...' : `Delete destination`}
|
|
confirmPlaceholder="Type in name of destination"
|
|
confirmString={name ?? 'Unknown'}
|
|
text={`This will delete the destination "${name}"`}
|
|
alert={{ title: 'You cannot recover this destination once deleted.' }}
|
|
onCancel={() => setVisible(!visible)}
|
|
onConfirm={onDelete}
|
|
/>
|
|
)
|
|
}
|