Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42 lines
919 B
TypeScript
42 lines
919 B
TypeScript
import clsx from 'clsx'
|
|
import { MarketContract } from 'common/contract'
|
|
import { useState } from 'react'
|
|
import { Button } from '../buttons/button'
|
|
|
|
import { AddLiquidityModal } from './liquidity-modal'
|
|
|
|
export function SubsidizeButton(props: {
|
|
contract: MarketContract
|
|
className?: string
|
|
}) {
|
|
const { contract, className } = props
|
|
const [open, setOpen] = useState(false)
|
|
|
|
const disabled =
|
|
contract.isResolved ||
|
|
(contract.closeTime ?? Infinity) < Date.now() ||
|
|
contract.visibility !== 'public'
|
|
|
|
if (disabled) return <></>
|
|
|
|
return (
|
|
<>
|
|
<Button
|
|
onClick={() => setOpen(true)}
|
|
size="md"
|
|
color="indigo-outline"
|
|
className={clsx(className, 'group')}
|
|
>
|
|
Add Liquidity
|
|
</Button>
|
|
{open && (
|
|
<AddLiquidityModal
|
|
contract={contract}
|
|
isOpen={open}
|
|
setOpen={setOpen}
|
|
/>
|
|
)}
|
|
</>
|
|
)
|
|
}
|