import { useState } from "react"; import { Button } from "../../components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "../../components/ui/dialog"; import { authClient } from "../../lib/auth-client"; import { type User } from "./types"; interface Props { user: User; open: boolean; onClose: () => void; onSuccess: () => void; } export function DeleteUserDialog({ user, open, onClose, onSuccess }: Props) { const [loading, setLoading] = useState(false); async function handleDelete() { setLoading(true); const { error } = await (authClient.admin as any).removeUser({ userId: user.id }); setLoading(false); if (!error) { onSuccess(); onClose(); } } return ( !o && onClose()}> Delete User

Delete {user.email}?

This action cannot be undone.

); }