import clsx from 'clsx'
import { useState } from 'react'
import { CurrencyDollarIcon } from '@heroicons/react/outline'
import { Contract } from 'common/contract'
import { COMMENT_BOUNTY_AMOUNT } from 'common/economy'
import { formatMoney } from 'common/util/format'
import { Tooltip } from 'web/components/tooltip'
import { CommentBountyDialog } from './comment-bounty-dialog'
export function BountiedContractBadge() {
return (
Bounty
)
}
export function BountiedContractSmallBadge(props: {
contract: Contract
showAmount?: boolean
}) {
const { contract, showAmount } = props
const { openCommentBounties } = contract
const [open, setOpen] = useState(false)
if (!openCommentBounties && !showAmount) return <>>
const modal = (
)
const bountiesClosed =
contract.isResolved || (contract.closeTime ?? Infinity) < Date.now()
if (!openCommentBounties) {
if (bountiesClosed) return <>>
return (
<>
{modal}
setOpen(true)} />
>
)
}
const tooltip = `${contract.creatorName} may award ${formatMoney(
COMMENT_BOUNTY_AMOUNT
)} for good comments. ${formatMoney(
openCommentBounties
)} currently available.`
return (
{modal}
setOpen(true)}
/>
)
}
function SmallBadge(props: { text: string; onClick?: () => void }) {
const { text, onClick } = props
return (
)
}