import clsx from 'clsx'; import { globals } from '@/utils/constants'; import { truncateToLastWord } from '@/utils/utils'; import { CProps } from '../props'; export interface TextContentProps extends CProps.Styling { text: string; maxLength?: number; } function TextContent({ className, text, maxLength, ...restProps }: TextContentProps) { const truncated = maxLength ? truncateToLastWord(text, maxLength) : text; const isTruncated = maxLength && text.length > maxLength; return (
{truncated}
); } export default TextContent;