Files
web/components/TempDesignSystem/Text/Caption/index.tsx
Christel Westerberg 323df671d8 fix: add loyaltyCard
2024-07-01 11:46:35 +02:00

30 lines
635 B
TypeScript

import { Slot } from "@radix-ui/react-slot"
import { captionVariants, fontOnlycaptionVariants } from "./variants"
import type { CaptionProps } from "./caption"
export default function Caption({
asChild = false,
className = "",
color,
fontOnly = false,
textAlign,
textTransform,
...props
}: CaptionProps) {
const Comp = asChild ? Slot : "p"
const classNames = fontOnly
? fontOnlycaptionVariants({
className,
textTransform,
})
: captionVariants({
className,
color,
textTransform,
textAlign,
})
return <Comp className={classNames} {...props} />
}