import { CircleAlert } from "lucide-react"; import type { ReactNode } from "react"; import { useI18n } from "../i18n"; import { formatDate } from "../lib/format"; import type { AuditLogRow } from "../types"; type Tone = "neutral" | "good" | "danger" | "warn"; export function PageFrame({ title, eyebrow, children, actions }: { title: string; eyebrow?: string; children: ReactNode; actions?: ReactNode; }) { return (
{eyebrow &&
{eyebrow}
}

{title}

{actions &&
{actions}
}
{children}
); } export function QueryPanel({ children }: { children: ReactNode }) { return
{children}
; } export function SplitLayout({ main, side }: { main: ReactNode; side: ReactNode }) { return (
{main}
); } export function SectionHead({ title, text, action }: { title: string; text?: string; action?: ReactNode }) { return (

{title}

{text &&

{text}

}
{action &&
{action}
}
); } export function Alert({ children }: { children: ReactNode }) { return
{children}
; } export function Badge({ children, tone = "neutral" }: { children: ReactNode; tone?: Tone }) { return {children}; } export function StatusItem({ label, value, tone }: { label: string; value: string; tone: "neutral" | "good" | "warn" }) { return (
{label} {value}
); } export function Metric({ label, value, tone = "neutral", mono = false }: { label: string; value: string; tone?: Tone; mono?: boolean }) { return (
{label} {value}
); } export function Summary({ label, value, mono = false }: { label: string; value: string; mono?: boolean }) { return (
{label} {value}
); } export function AuditTable({ rows }: { rows: AuditLogRow[] }) { const { t } = useI18n(); return (
{rows.map((row) => ( ))} {rows.length === 0 && }
{t("audit.id")}{t("audit.commandID")}{t("audit.action")}{t("audit.actor")}{t("audit.status")}{t("audit.dryRun")}{t("audit.reason")}{t("audit.time")}
{row.ID} {row.CommandID} {row.Action} {row.Actor} {row.Status} {row.DryRun ? t("common.yes") : t("common.no")} {row.Reason} {formatDate(row.CreatedAt)}
); } export function EmptyRow({ colSpan }: { colSpan: number }) { const { t } = useI18n(); return {t("common.noResults")}; } export function LoadingSurface({ label }: { label: string }) { return
{label}
; } export function JsonBlock({ value }: { value: string }) { return
{value || "{}"}
; }