| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { cn } from '@/lib/utils';
- import type { HeaderSection } from '../types';
- import { Container, SfButton } from '../ui';
-
- export function Header({ section }: { section: HeaderSection }) {
- const { logoText, links, cta } = section.content;
- const centered = section.variant === 'centered';
-
- return (
- <header
- id={section.id}
- className="sticky top-0 z-20 border-b border-(--sf-border) bg-(--sf-bg)/90 backdrop-blur"
- >
- <Container
- className={cn(
- 'flex items-center gap-6 py-4',
- centered ? 'flex-col sm:gap-3' : 'justify-between',
- )}
- >
- <a href="#" className="sf-heading text-xl font-semibold">
- {logoText}
- </a>
-
- <nav
- aria-label="Main"
- className={cn(
- 'items-center gap-7 text-sm',
- centered
- ? 'flex flex-wrap justify-center'
- : 'hidden md:flex',
- )}
- >
- {links.map((link) => (
- <a
- key={link.label + link.href}
- href={link.href}
- className="text-(--sf-muted) transition-colors hover:text-(--sf-fg)"
- >
- {link.label}
- </a>
- ))}
- </nav>
-
- {cta && !centered && (
- <SfButton href={cta.href} className="px-4 py-2">
- {cta.label}
- </SfButton>
- )}
- </Container>
- </header>
- );
- }
|