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 22 23 24 25 26 | 1x 1x 26x 26x 9x 17x | 'use client';
import { Text, type TextProps, Title, type TitleProps } from '@mantine/core';
import clsx from 'clsx';
import classes from './StyledText.module.css';
import type { StyledTextProps } from './types';
export const StyledText = <C extends 'title' | 'text' = 'text'>({
componentType = 'text' as C,
gradient = false,
className,
...props
}: StyledTextProps<C>) => {
const combinedClassName = clsx(className, {
[classes.gradientText]: gradient,
});
if (componentType === 'title') {
return <Title className={combinedClassName} {...(props as TitleProps)} />;
}
return <Text className={combinedClassName} {...(props as TextProps)} />;
};
export default StyledText;
|