import type { ComponentProps, ReactNode } from "react"; import { AlertCircle, CheckCircle2, CircleHelp, Info, TriangleAlert } from "lucide-react"; import { cn } from "@/shared/ui/cn"; export type WorkbenchTone = "neutral" | "info" | "success" | "warning" | "danger" | "teal"; const sectionTone: Record = { neutral: "bg-[var(--surface-control)] text-slate-600", info: "bg-[var(--action-soft)] text-[var(--action-blue-hover)]", success: "bg-emerald-50 text-emerald-700", warning: "bg-[var(--status-warning-soft)] text-[var(--status-warning-foreground)]", danger: "bg-rose-50 text-rose-700", teal: "bg-cyan-50 text-cyan-800" }; const noticeTone: Record, string> = { neutral: "border-[var(--surface-border)] bg-[var(--surface-reading)] text-slate-700", info: "border-[var(--action-blue)] bg-[var(--action-soft)]/80 text-[var(--action-blue-pressed)]", success: "border-emerald-500 bg-emerald-50/80 text-emerald-950", warning: "border-[var(--status-warning-mark)] bg-[var(--status-warning-soft)]/90 text-[var(--status-warning-foreground)]", danger: "border-rose-500 bg-rose-50/90 text-rose-950" }; const noticeIcon = { neutral: CircleHelp, info: Info, success: CheckCircle2, warning: TriangleAlert, danger: AlertCircle }; export function WorkbenchSection({ title, description, icon, meta, actions, tone = "neutral", bodyClassName, className, children, ...props }: ComponentProps<"section"> & { title: ReactNode; description?: ReactNode; icon?: ReactNode; meta?: ReactNode; actions?: ReactNode; tone?: WorkbenchTone; bodyClassName?: string; }) { return (
{icon ? ( {icon} ) : null}

{title}

{meta}
{description ?

{description}

: null}
{actions ?
{actions}
: null}
{children}
); } export function WorkbenchNotice({ tone = "info", title, icon, className, children, ...props }: ComponentProps<"div"> & { tone?: Exclude; title?: ReactNode; icon?: ReactNode; }) { const Icon = noticeIcon[tone]; return (
{title ?

{title}

: null}
{children}
); } export function WorkbenchEmptyState({ icon, title, description, action, className }: { icon?: ReactNode; title: ReactNode; description?: ReactNode; action?: ReactNode; className?: string; }) { return (
{icon ? {icon} : null}

{title}

{description ?

{description}

: null} {action ?
{action}
: null}
); }