Files
web/components/TempDesignSystem/Title/index.tsx
2024-05-30 17:56:56 +02:00

26 lines
477 B
TypeScript

import { headingVariants } from "./variants"
import type { HeadingProps } from "./title"
export default function Title({
as,
children,
className = "",
color,
hideEmpty = true,
level = "h1",
textTransform,
}: HeadingProps) {
if (hideEmpty && !children) {
return null
}
const Hx = level
const classNames = headingVariants({
className,
color,
textTransform,
type: as ?? level,
})
return <Hx className={classNames}>{children}</Hx>
}