Files
web/components/Title/index.tsx
2024-04-29 14:01:20 +02:00

22 lines
464 B
TypeScript

import { headingVariants } from "./variants"
import type { HeadingProps } from "@/types/components/myPages/title"
export default function Title({
as,
children,
className = "",
level = "h1",
uppercase = false,
weight,
}: HeadingProps) {
const Hx = level
const classNames = headingVariants({
className,
text: uppercase ? "uppercase" : undefined,
type: as ?? level,
weight,
})
return <Hx className={classNames}>{children}</Hx>
}