Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 97x 97x | import type { ElementType } from "react";
import { TEXT_VARIANT_CLASSES } from "@/constants/text";
import type { TextProps } from "@/types/text";
import { cn } from "@/utils/class-name";
export function Text<T extends ElementType = "p">({
as,
variant = "body",
className,
...props
}: TextProps<T>) {
const Component = as ?? "p";
return (
<Component
className={cn(TEXT_VARIANT_CLASSES[variant], className)}
{...props}
/>
);
}
|