2025-02-14 13:11:53 +01:00
|
|
|
import { NoteRender } from 'components/Notes/NoteRender'
|
|
|
|
import { useTextLimit } from 'hooks'
|
|
|
|
|
2025-01-29 21:23:29 +01:00
|
|
|
interface CommentContentProps {
|
|
|
|
content: string
|
|
|
|
}
|
2025-02-14 13:11:53 +01:00
|
|
|
|
2025-01-29 21:23:29 +01:00
|
|
|
export const CommentContent = ({ content }: CommentContentProps) => {
|
|
|
|
const { text, isTextOverflowing, isExpanded, toggle } = useTextLimit(content)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2025-02-14 13:11:53 +01:00
|
|
|
{isExpanded && (
|
|
|
|
<div
|
|
|
|
className='IBMSMSMBSSCL_CBExpand IBMSMSMBSSCL_CBExpandAlt'
|
|
|
|
onClick={toggle}
|
|
|
|
>
|
|
|
|
<p>Hide full post</p>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
<p className='IBMSMSMBSSCL_CBText'>
|
|
|
|
<NoteRender content={text} />
|
|
|
|
</p>
|
2025-02-15 14:09:04 +01:00
|
|
|
{isTextOverflowing && !isExpanded && (
|
2025-01-29 21:23:29 +01:00
|
|
|
<div className='IBMSMSMBSSCL_CBExpand' onClick={toggle}>
|
2025-02-15 14:09:04 +01:00
|
|
|
<p>View full post</p>
|
2025-01-29 21:23:29 +01:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|