DeleteDestination.tsx33 lines · main
| 1 | import { TextConfirmModal } from '@/components/ui/TextConfirmModalWrapper' |
| 2 | |
| 3 | interface DeleteDestinationProps { |
| 4 | visible: boolean |
| 5 | isLoading: boolean |
| 6 | name: string |
| 7 | setVisible: (value: boolean) => void |
| 8 | onDelete: () => void |
| 9 | } |
| 10 | |
| 11 | export const DeleteDestination = ({ |
| 12 | visible, |
| 13 | isLoading, |
| 14 | name, |
| 15 | setVisible, |
| 16 | onDelete, |
| 17 | }: DeleteDestinationProps) => { |
| 18 | return ( |
| 19 | <TextConfirmModal |
| 20 | variant="destructive" |
| 21 | visible={visible} |
| 22 | loading={isLoading} |
| 23 | title="Delete this destination" |
| 24 | confirmLabel={isLoading ? 'Deleting...' : `Delete destination`} |
| 25 | confirmPlaceholder="Type in name of destination" |
| 26 | confirmString={name ?? 'Unknown'} |
| 27 | text={`This will delete the destination "${name}"`} |
| 28 | alert={{ title: 'You cannot recover this destination once deleted.' }} |
| 29 | onCancel={() => setVisible(!visible)} |
| 30 | onConfirm={onDelete} |
| 31 | /> |
| 32 | ) |
| 33 | } |