22 lines
376 B
TypeScript
22 lines
376 B
TypeScript
import type { ElementType, ReactNode } from "react";
|
|
|
|
interface SectionProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
as?: ElementType;
|
|
}
|
|
|
|
export function Section({
|
|
children,
|
|
className = "",
|
|
as: Tag = "section",
|
|
}: SectionProps) {
|
|
return (
|
|
<Tag
|
|
className={`py-[var(--section-spacing-y)] ${className}`.trim()}
|
|
>
|
|
{children}
|
|
</Tag>
|
|
);
|
|
}
|