// Page building blocks of the console (PEP-38): header, sections, empty states, status badges, alerts.
import Link from "next/link";
import type { ReactNode } from "react";
import { CircleAlert, CircleCheck } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import { SESSION_STATUS, TASK_STATUS, TONE_BG } from "@/lib/status";
import { cn } from "@/lib/utils";
export function PageHeader({ title, crumbs, actions, children }: { title: ReactNode; crumbs?: ReactNode; actions?: ReactNode; children?: ReactNode }) {
return (
{title}
{actions && {title}
{count != null && count > 0 && {count}}
{actions &&
{children}
; } /** Monospace task/project key, optionally a link. */ export function Key({ children, href, className }: { children: ReactNode; href?: string; className?: string }) { const cls = cn("font-mono text-[0.9em] whitespace-nowrap", href ? "text-primary hover:underline" : "text-muted-foreground", className); return href ? {children} : {children}; } export function StatusBadge({ status, kind = "task" }: { status: string; kind?: "task" | "session" }) { const s = (kind === "task" ? TASK_STATUS : SESSION_STATUS)[status] ?? { label: status, tone: "muted" as const }; return (