import React, { useState } from 'react' import { Button, Typography } from 'antd' const { Text } = Typography const { Title } = Typography export const SpoilerButton = ({ text, children, style }) => { const [opened, setOpened] = useState(false) return ( <> {opened && children} ) } export const ReplyButton = ({ text, children, style }) => { const [opened, setOpened] = useState(false) return ( <> { setOpened(!opened) }} style={style} > {text} {opened && children} ) } export const ViewComment = ({ text, count, children, style,textClosed }) => { const [opened, setOpened] = useState(false) return ( <> { setOpened(!opened) }} // style={style} > { !opened ? text + count + ' comments' : textClosed} {
{opened && children}
} ) }