"use client"; import { rename, remove } from "@/lib/actions"; export function HistoryItem({ row }: { row: { id: string; title: string; status: string; created_at: number } }) { // The server actions take (previousState, formData) for useActionState; a plain
passes only // formData, so bind the unused slot here rather than duplicating two single-arg actions. const doRename = (fd: FormData) => rename(null, fd); const doRemove = (fd: FormData) => remove(null, fd); const when = new Date(row.created_at).toLocaleString(undefined, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }); return
  • {row.title}{row.status !== "done" && {row.status}}
    {when} {/* Delete is the only destructive action in the product: it never fires on a stray click. */}
    { if (!confirm("Delete this analysis?")) e.preventDefault(); }}>
  • ; }