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>
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { Contract } from 'common/contract'
|
|
import { Col } from '../layout/col'
|
|
import { LoadingIndicator } from '../widgets/loading-indicator'
|
|
import { LoadMoreUntilNotVisible } from 'web/components/widgets/visibility-observer'
|
|
import { FeedContractCard } from './feed-contract-card'
|
|
|
|
export function ContractsGrid(props: {
|
|
contracts: Contract[] | undefined
|
|
loadMore?: () => Promise<boolean>
|
|
trackingPostfix?: string
|
|
breakpointColumns?: { [key: string]: number }
|
|
}) {
|
|
const { contracts, loadMore, trackingPostfix } = props
|
|
if (contracts === undefined) {
|
|
return <LoadingIndicator />
|
|
}
|
|
|
|
if (contracts.length === 0) {
|
|
return null // handle empty state outside of component
|
|
}
|
|
|
|
return (
|
|
<Col className="gap-2">
|
|
{contracts.map((contract) => (
|
|
<FeedContractCard
|
|
contract={contract}
|
|
key={contract.id}
|
|
trackingPostfix={trackingPostfix}
|
|
size={'sm'}
|
|
/>
|
|
))}
|
|
{loadMore && <LoadMoreUntilNotVisible loadMore={loadMore} />}
|
|
</Col>
|
|
)
|
|
}
|