changed name of comments file
This commit is contained in:
parent
93e32e3090
commit
1953539d80
29
web/components/comments/reply-toggle.tsx
Normal file
29
web/components/comments/reply-toggle.tsx
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import clsx from 'clsx'
|
||||||
|
import TriangleDownFillIcon from 'web/lib/icons/triangle-down-fill-icon'
|
||||||
|
import { Row } from '../layout/row'
|
||||||
|
|
||||||
|
export function ReplyToggle(props: {
|
||||||
|
seeReplies: boolean
|
||||||
|
numComments: number
|
||||||
|
onClick: () => void
|
||||||
|
}) {
|
||||||
|
const { seeReplies, numComments, onClick } = props
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
className={clsx(
|
||||||
|
'text-left text-sm text-indigo-600',
|
||||||
|
numComments === 0 ? 'hidden' : ''
|
||||||
|
)}
|
||||||
|
onClick={onClick}
|
||||||
|
>
|
||||||
|
<Row className="items-center gap-1">
|
||||||
|
<div>
|
||||||
|
{numComments} {numComments === 1 ? 'Reply' : 'Replies'}
|
||||||
|
</div>
|
||||||
|
<TriangleDownFillIcon
|
||||||
|
className={clsx('h-2 w-2', seeReplies ? 'rotate-180' : '')}
|
||||||
|
/>
|
||||||
|
</Row>
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user