portfolio/components/SimpleLayout.tsx

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-01-14 19:31:05 +00:00
import {ReactNode} from 'react'
2022-12-06 12:54:34 +00:00
import clsx from 'clsx'
2023-01-14 19:31:05 +00:00
import {Container} from './Container'
2022-12-06 12:54:34 +00:00
2023-01-14 23:18:52 +00:00
type SimpleLayout = {
title: string
intro: string
children: ReactNode
gradient: string
}
2023-01-14 19:31:05 +00:00
export function SimpleLayout({
title,
intro,
children,
gradient
2023-01-14 23:18:52 +00:00
}: SimpleLayout) {
2022-12-06 12:54:34 +00:00
return (
<Container className="mt-16 sm:mt-32">
<header className="max-w-2xl">
<h1
className={clsx(gradient
? `${gradient} bg-clip-text dark:text-transparent`
: '', 'text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl')}>
{title}
</h1>
<p className="mt-6 text-base text-zinc-600 dark:text-zinc-400">
{intro}
</p>
</header>
<div className="mt-16 sm:mt-20">{children}</div>
</Container>
)
}