import React, { FC, useState } from 'react'; import { Typography } from '..'; import { ExpandableTextProps } from './interfaces'; import { Wrapper } from './styles'; export const ExpandableText: FC = ({ shortText, longText, expandButtonText, onExpand, typographyVariant, }: ExpandableTextProps) => { const [isExpanded, setIsExpanded] = useState(false); const handleExpandClick = () => { if (onExpand) { onExpand(); } setIsExpanded(true); }; const tappableText = expandButtonText || 'Read More'; const text = isExpanded ? ( {longText} ) : ( {shortText} ... {tappableText} ); return {text}; };