2025-01-29 21:23:29 +01:00
|
|
|
import { useTextLimit } from 'hooks/useTextLimit'
|
|
|
|
interface CommentContentProps {
|
|
|
|
content: string
|
|
|
|
}
|
|
|
|
export const CommentContent = ({ content }: CommentContentProps) => {
|
|
|
|
const { text, isTextOverflowing, isExpanded, toggle } = useTextLimit(content)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2025-01-30 09:40:12 +01:00
|
|
|
<p className='IBMSMSMBSSCL_CBText'>{text}</p>
|
2025-01-29 21:23:29 +01:00
|
|
|
{isTextOverflowing && (
|
|
|
|
<div className='IBMSMSMBSSCL_CBExpand' onClick={toggle}>
|
|
|
|
<p>{isExpanded ? 'Hide' : 'View'} full post</p>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|