DeleteDestination.tsx 890 B

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