portfolio/components/ui/Section.tsx

22 lines
717 B
TypeScript
Raw Permalink Normal View History

2023-03-18 21:15:45 +00:00
import {ReactNode, useId} from 'react'
2022-12-06 12:54:34 +00:00
2023-03-18 21:15:45 +00:00
export function Section({title, children}: { title: string, children: ReactNode }) {
2023-01-14 19:31:05 +00:00
let id = useId()
2022-12-06 12:54:34 +00:00
2023-01-14 19:31:05 +00:00
return (
<section
aria-labelledby={id}
className="md:border-l md:border-zinc-100 md:pl-6 md:dark:border-zinc-700/40"
2022-12-06 12:54:34 +00:00
>
2023-01-14 19:31:05 +00:00
<div className="grid max-w-3xl grid-cols-1 items-baseline gap-y-8 md:grid-cols-4">
<h2
id={id}
className="text-sm font-semibold text-zinc-800 dark:text-zinc-100"
>
{title}
</h2>
<div className="md:col-span-3">{children}</div>
</div>
</section>
)
}