"use client"; import { HTMLAttributes } from "react"; import { clsx } from "clsx"; // ============================================================================= // SectionHeader Types // ============================================================================= export interface SectionHeaderProps extends HTMLAttributes { title: string; subtitle?: string; actionText?: string; actionHref?: string; actionOnClick?: () => void; icon?: React.ReactNode; titleSize?: "page" | "section" | "card" | "small"; showDivider?: boolean; } export interface PageHeaderProps extends SectionHeaderProps { backHref?: string; backText?: string; actionSlot?: React.ReactNode; } // ============================================================================= // SharedSectionHeader Component // ============================================================================= export function SharedSectionHeader({ title, subtitle, actionText, actionHref, actionOnClick, icon, titleSize = "section", showDivider = false, className, ...props }: SectionHeaderProps) { // Map title size to styles const titleStyles = { page: { className: "text-[26px] font-bold tracking-[-0.02em] text-[var(--text-primary)]", }, section: { className: "text-[24px] font-bold tracking-[-0.02em] text-[var(--text-primary)]", }, card: { className: "text-[18px] font-bold text-[var(--text-primary)]", }, small: { className: "text-[15px] font-semibold text-[var(--text-primary)]", }, }; const style = titleStyles[titleSize]; return (
{icon && (
{icon}
)}

{title}

{subtitle && (

{subtitle}

)}
{(actionText || actionHref || actionOnClick) && (
{actionHref ? ( {actionText} ) : actionOnClick ? ( ) : null}
)}
{showDivider ? ); } // ============================================================================= // Section Label (uppercase small label) // ============================================================================= export function SectionLabel({ children, className, accent = false, ...props }: HTMLAttributes & { accent?: boolean }) { return (

{children}

); } // ============================================================================= // Page Header (with back link option) // ============================================================================= export function PageHeader({ title, subtitle, backHref, backText = "Back", actionSlot, className, ...props }: PageHeaderProps) { return (
{backHref && ( ← {backText} )}

{title}

{subtitle && (

{subtitle}

)}
{actionSlot &&
{actionSlot}
}
); }