import { cn } from '@/lib/utils'; import { ReactNode } from 'react'; /** * HeaderProps interface defines the props for the Header component. */ interface HeaderProps { /** * The title of the header. */ title: string; /** * The subtitle of the header. */ subtitle?: string; /** * An array of actions to display in the header. */ actions?: ReactNode[]; /** * A back button to display in the header. */ backButton?: ReactNode; /** * Optional CSS class names to apply to the header. */ className?: string; /** * The layout of the header. * @default 'default' */ layout?: 'default' | 'compact'; } /** * A component that renders a header with a title, subtitle, actions, and back button. * * @param {HeaderProps} props - The props for the component. * @returns {React.ReactElement} A div element containing the header content. */ export function Header({ title, subtitle, actions, backButton, className, layout = 'default', }: HeaderProps) { return (
{backButton}

{title}

{subtitle && (

{subtitle}

)}
{actions && actions.length > 0 && (
{actions.map((action, index) => (
{action}
))}
)}
); }