diff --git a/web/components/answers/answers-panel.tsx b/web/components/answers/answers-panel.tsx index 83200b2a..d15b7e94 100644 --- a/web/components/answers/answers-panel.tsx +++ b/web/components/answers/answers-panel.tsx @@ -25,6 +25,8 @@ import { UserLink } from 'web/components/user-link' import { Button } from 'web/components/button' import { useAdmin } from 'web/hooks/use-admin' import { needsAdminToResolve } from 'web/pages/[username]/[contractSlug]' +import { CATEGORY_COLORS } from '../charts/contract/choice' +import { getChartAnswers } from '../charts/contract/choice' export function AnswersPanel(props: { contract: FreeResponseContract | MultipleChoiceContract @@ -38,6 +40,7 @@ export function AnswersPanel(props: { const answers = (useAnswers(contract.id) ?? contract.answers).filter( (a) => a.number != 0 || contract.outcomeType === 'MULTIPLE_CHOICE' ) + const hasZeroBetAnswers = answers.some((answer) => totalBets[answer.id] < 1) const [winningAnswers, losingAnswers] = partition( @@ -104,6 +107,11 @@ export function AnswersPanel(props: { ? 'checkbox' : undefined + const colorSortedAnswer = getChartAnswers( + contract, + CATEGORY_COLORS.length + ).map((value, index) => value.text) + return (