'use client' import { useState } from 'react' import { Button } from '@/components/ui/button' import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, DialogFooter, } from '@/components/ui/dialog' import { Input } from '@/components/ui/input' import { Plus } from 'lucide-react' import { createUser } from '@/app/actions/admin' import { toast } from 'sonner' export function CreateUserDialog() { const [open, setOpen] = useState(false) return ( Create User Add a new user to the system. They will need to change their password upon first login if you implement that policy.
{ const result = await createUser(formData) if (result?.error) { toast.error('Failed to create user') } else { toast.success('User created successfully') setOpen(false) } }} className="grid gap-4 py-4" >
) }