predikt/oracle/web/components/multi-checkbox.tsx
caelum0x 2b68bde5d5 Predikt: full Polymarket-style prediction market — web + mobile + on-chain + bots
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>
2026-07-06 23:29:50 +03:00

29 lines
773 B
TypeScript

import { Row } from 'web/components/layout/row'
import { Checkbox } from 'web/components/widgets/checkbox'
export const MultiCheckbox = (props: {
choices: { [key: string]: string }
selected: string[]
onChange: (selected: string[]) => void
}) => {
const { choices, selected, onChange } = props
return (
<Row className={'flex-wrap gap-3'}>
{Object.entries(choices).map(([key, value]) => (
<Checkbox
key={key}
label={key}
checked={selected.includes(value)}
toggle={(checked: boolean) => {
if (checked) {
onChange([...selected, value])
} else {
onChange(selected.filter((s) => s !== value))
}
}}
/>
))}
</Row>
)
}