'use client' import { useState } from 'react' import { IconAlertTriangle } from '@tabler/icons-react' import { showSubmittedData } from '@/utils/show-submitted-data' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { ConfirmDialog } from '@/components/confirm-dialog' import { User } from '../data/schema' interface Props { open: boolean onOpenChange: (open: boolean) => void currentRow: User } export function UsersDeleteDialog({ open, onOpenChange, currentRow }: Props) { const [value, setValue] = useState('') const handleDelete = () => { if (value.trim() !== currentRow.username) return onOpenChange(false) showSubmittedData(currentRow, 'The following user has been deleted:') } return ( {' '} Delete User } desc={

Are you sure you want to delete{' '} {currentRow.username}?
This action will permanently remove the user with the role of{' '} {currentRow.role.toUpperCase()} {' '} from the system. This cannot be undone.

Warning! Please be carefull, this operation can not be rolled back.
} confirmText='Delete' destructive /> ) }