'use client'; import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from '@kit/ui/alert-dialog'; import { Button } from '@kit/ui/button'; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from '@kit/ui/form'; import { Input } from '@kit/ui/input'; import { deleteUser } from '../lib/server/admin-server-actions'; import { DeleteUserSchema } from '../lib/server/schema/admin-actions.schema'; export function AdminDeleteUserDialog( props: React.PropsWithChildren<{ userId: string; }>, ) { const form = useForm({ resolver: zodResolver(DeleteUserSchema), defaultValues: { userId: props.userId, confirmation: '', }, }); return ( {props.children} Delete User Are you sure you want to delete this user? All the data associated with this user will be permanently deleted. Any active subscriptions will be canceled.
( Type CONFIRM to confirm Are you sure you want to do this? This action cannot be undone. )} /> Cancel
); }