Files
Tom Chien (IQ-AS) 5fe2ecd757
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Successful in 4m7s
upload
2026-11-18 18:41:41 +08:00

37 lines
983 B
TypeScript

import type { ReactNode } from "react";
export function Section({
id,
eyebrow,
title,
lead,
compactTop = false,
children,
}: {
id: string;
eyebrow: string;
title: string;
lead?: ReactNode;
/** Trim the top padding when the section follows another one, so the gap between them isn't doubled. */
compactTop?: boolean;
children: ReactNode;
}) {
return (
<section
id={id}
className={`scroll-mt-16 pb-16 sm:pb-24 ${compactTop ? "pt-2 sm:pt-4" : "pt-16 sm:pt-24"}`}
>
<div className="mx-auto w-full max-w-6xl px-6">
<p className="text-sm font-semibold tracking-widest text-sky-400 uppercase">
{eyebrow}
</p>
<h2 className="mt-2 text-3xl font-bold tracking-tight text-white sm:text-4xl">
{title}
</h2>
{lead && <div className="mt-4 max-w-3xl text-base leading-7 text-slate-300">{lead}</div>}
<div className="mt-10">{children}</div>
</div>
</section>
);
}