2022-09-28 03:24:42 +00:00
|
|
|
import { Contract } from 'common/contract'
|
|
|
|
import { Bet } from 'common/bet'
|
|
|
|
import { BinaryContractChart } from './binary'
|
|
|
|
import { PseudoNumericContractChart } from './pseudo-numeric'
|
|
|
|
import { ChoiceContractChart } from './choice'
|
|
|
|
import { NumericContractChart } from './numeric'
|
|
|
|
|
|
|
|
export const ContractChart = (props: {
|
|
|
|
contract: Contract
|
|
|
|
bets: Bet[]
|
2022-09-30 23:57:48 +00:00
|
|
|
width: number
|
|
|
|
height: number
|
2022-09-28 03:24:42 +00:00
|
|
|
}) => {
|
|
|
|
const { contract } = props
|
|
|
|
switch (contract.outcomeType) {
|
|
|
|
case 'BINARY':
|
|
|
|
return <BinaryContractChart {...{ ...props, contract }} />
|
|
|
|
case 'PSEUDO_NUMERIC':
|
|
|
|
return <PseudoNumericContractChart {...{ ...props, contract }} />
|
|
|
|
case 'FREE_RESPONSE':
|
|
|
|
case 'MULTIPLE_CHOICE':
|
|
|
|
return <ChoiceContractChart {...{ ...props, contract }} />
|
|
|
|
case 'NUMERIC':
|
|
|
|
return <NumericContractChart {...{ ...props, contract }} />
|
|
|
|
default:
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
BinaryContractChart,
|
|
|
|
PseudoNumericContractChart,
|
|
|
|
ChoiceContractChart,
|
|
|
|
NumericContractChart,
|
|
|
|
}
|