first commit
This commit is contained in:
71
apps/suman-hrvatska/src/components/ui/section-header.tsx
Normal file
71
apps/suman-hrvatska/src/components/ui/section-header.tsx
Normal file
@@ -0,0 +1,71 @@
|
||||
import React from "react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface SectionHeaderProps {
|
||||
kicker?: string
|
||||
title: string
|
||||
description?: string
|
||||
action?: React.ReactNode
|
||||
className?: string
|
||||
titleClassName?: string
|
||||
kickerClassName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* SectionHeader / SectionHeader1
|
||||
* Unificirana komponenta sa podijeljenim zaglavljem:
|
||||
* - Lijevo: Kicker / oznaka sekcije (npr. "Naši Proizvodi", "Naša Misija")
|
||||
* - Desno: Veliki naslov i opcioni opis ili CTA
|
||||
*/
|
||||
export function SectionHeader({
|
||||
kicker,
|
||||
title,
|
||||
description,
|
||||
action,
|
||||
className,
|
||||
titleClassName,
|
||||
kickerClassName,
|
||||
}: SectionHeaderProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col lg:flex-row lg:items-start justify-between gap-6 mb-12 sm:mb-16",
|
||||
className
|
||||
)}
|
||||
>
|
||||
{/* Left Column: Kicker */}
|
||||
{kicker && (
|
||||
<div
|
||||
className={cn(
|
||||
"text-sm font-semibold tracking-wide text-muted-foreground uppercase shrink-0 pt-1.5",
|
||||
kickerClassName
|
||||
)}
|
||||
>
|
||||
{kicker}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Right Column: Title & Description */}
|
||||
<div className="max-w-2xl space-y-3">
|
||||
<h2
|
||||
className={cn(
|
||||
"text-3xl sm:text-4xl lg:text-5xl font-medium tracking-tight text-foreground leading-[1.18]",
|
||||
titleClassName
|
||||
)}
|
||||
>
|
||||
{title}
|
||||
</h2>
|
||||
{description && (
|
||||
<p className="text-base sm:text-lg text-muted-foreground leading-relaxed">
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
{action && <div className="pt-2">{action}</div>}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const SectionHeader1 = SectionHeader
|
||||
export default SectionHeader
|
||||
|
||||
Reference in New Issue
Block a user