import { JSX, Show, splitProps, mergeProps } from 'solid-js'; type SectionHeaderProps = { label?: JSX.Element; title: JSX.Element; description?: JSX.Element; align?: 'left' | 'center'; size?: 'sm' | 'md' | 'lg'; titleClass?: string; descriptionClass?: string; } & Omit, 'title'>; export function SectionHeader(props: SectionHeaderProps) { const merged = mergeProps( { align: 'left' as const, size: 'md' as const, titleClass: '', descriptionClass: '' }, props, ); const [local, rest] = splitProps(merged, [ 'label', 'title', 'description', 'align', 'size', 'titleClass', 'descriptionClass', 'class', ]); const alignmentClass = local.align === 'center' ? 'text-center items-center' : 'text-left items-start'; const sizeClass = () => { switch (local.size) { case 'sm': return 'text-base sm:text-lg'; case 'lg': return 'text-xl sm:text-2xl lg:text-3xl'; default: return 'text-lg sm:text-xl'; } }; return (
{local.label}

{local.title}

{local.description}

); } export default SectionHeader;