import type { ReactNode } from "react"; import { cn } from "@/lib/utils"; /** * Shared tactical "dossier" primitives for dashboard hero widgets, following * the recipe in src/components/frontend/AGENTS.md (reference implementation: * CampaignCard). Each piece is separable: frames can take just the strip, or * brackets, or a readout footer. Dense widgets stay conventional shadcn so * these surfaces stand out. */ /** Deterministic 3-digit reference code derived from a seed (id, username...). */ export function refCodeFrom(seed: string | number): string { const value = String(seed); let hash = 5381; for (let i = 0; i < value.length; i += 1) { hash = ((hash << 5) + hash + value.charCodeAt(i)) >>> 0; } return String(hash % 1000).padStart(3, "0"); } interface TacticalFrameProps { /** Left classification-strip label, e.g. "Personnel // Service Record". */ classification: string; /** Right strip label, e.g. "REF 042". Omit to hide. */ refCode?: string; children: ReactNode; /** Optional permanent readout bar pinned to the bottom edge. */ footer?: ReactNode; /** Corner brackets, default on. Turn off for bar-shaped surfaces. */ brackets?: boolean; className?: string; } export function TacticalFrame({ classification, refCode, children, footer, brackets = true, className, }: TacticalFrameProps) { return (