'use client' import { useState } from 'react' import { AlertTriangle } from 'lucide-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 { type User } from '../data/schema' type UserDeleteDialogProps = { open: boolean onOpenChange: (open: boolean) => void currentRow: User } export function UsersDeleteDialog({ open, onOpenChange, currentRow, }: UserDeleteDialogProps) { 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 careful, this operation can not be rolled back.
} confirmText='Delete' destructive /> ) }