import { toast } from "sonner" import type { ItemDetail } from "@workspace/types" import { Button } from "@workspace/ui/components/button" import { Card, CardContent, CardHeader, CardTitle } from "@workspace/ui/components/card" import { AccountLink } from "@/components/account-link" import { useItemAction } from "@/lib/api" /** A takedown the agent proposed, which happens only when the maintainer confirms it here. */ export function TakedownCard({ item }: { item: ItemDetail }) { const act = useItemAction(item.id) const pending = item.moderationPending if (pending?.action !== "takedown") return null const run = (action: "confirm-takedown" | "cancel-moderation", done: string) => act.mutate({ action }, { onSuccess: () => toast.success(done), onError: (e) => toast.error(e.message) }) return ( Take down {item.subject ? : "this account"}? {pending.reason &&

{pending.reason}

}

The account and everything it posted disappear from grain, and every open report on it is closed. It can be reversed with grain admin takedown {item.subject?.did ?? ""} --undo.

) }