Feat(WEB-307) Display correct membership information * fix: fix typo * chore: update fetch of user membership * chore: update components to use api data * chore: remove lang as static value * fix: adapt to dev updates * fix: adapt to code from dev * fix: break out MembershipLevel into its a React component * fix: add enum to zod validation * refactor: rename tier to level * refactor: remove unnecessary casts * refactor: change toString() to hideEmpty=false * refactor: remove toString() * refactor: remove hideEmpty from title and subtitle * fix: update currentLevel with data * fix: fix from rebase Approved-by: Michael Zetterberg
29 lines
536 B
TypeScript
29 lines
536 B
TypeScript
import { Children } from "react"
|
|
|
|
import { headingVariants } from "./variants"
|
|
|
|
import type { HeadingProps } from "./title"
|
|
|
|
export default function Title({
|
|
as,
|
|
children,
|
|
className = "",
|
|
color,
|
|
level = "h1",
|
|
textAlign,
|
|
textTransform,
|
|
}: HeadingProps) {
|
|
if (Children.toArray(children).length === 0) {
|
|
return null
|
|
}
|
|
const Hx = level
|
|
const classNames = headingVariants({
|
|
className,
|
|
color,
|
|
textAlign,
|
|
textTransform,
|
|
type: as ?? level,
|
|
})
|
|
return <Hx className={classNames}>{children}</Hx>
|
|
}
|