import React, { useState } from 'react'; interface Props { /** * The text shown on the button */ buttonText?: string; /** * The text shown on the button when all is shown */ lessButtonText?: string; /** * Style of the button */ buttonTheme?: string; /** * the value to show in the div */ children: string; /** * How many characters until the read more link shows */ threshold?: number; /** * Style of the children */ theme?: string; } const SeeMore = ({ buttonText = ' Read More...', lessButtonText = ' Read Less...', buttonTheme = 'font--14 font--dark border--none bg--light block text--left padding--none', children = '
Default
', theme = 'font--14 font--dark', threshold = 255, }: Props) => { const [hide, hideSetter] = useState(threshold); return (
{hide !== -1 && ( )} {hide === -1 && ( )}
); }; export default SeeMore;