2021-07-15 00:09:42 +02:00
|
|
|
import React from 'react';
|
|
|
|
// import { Arrow } from './Arrow';
|
|
|
|
import './NumberSelector.css'
|
2021-07-15 21:24:11 +02:00
|
|
|
import { PercentageOverlay } from './PercentageOverlay';
|
2021-07-15 00:09:42 +02:00
|
|
|
|
|
|
|
// setType: (txt: string) => void
|
|
|
|
// choices: { label: string, value: string }[]
|
|
|
|
// selected: string
|
|
|
|
export function NumberSelector({ setType, choices, selected }) {
|
|
|
|
return (
|
|
|
|
<div className="numberSelector">
|
|
|
|
{choices.map(v=>(
|
|
|
|
<div key={v.value} className="choiceWrapper">
|
2021-07-15 21:04:47 +02:00
|
|
|
<div className={`choice ${selected&&selected===v.value?'selected':''}`} onClick={() => setType(v.value)}>
|
2021-07-15 00:09:42 +02:00
|
|
|
{v.label}
|
2021-07-15 21:24:11 +02:00
|
|
|
<PercentageOverlay percentage={v.percentage} />
|
2021-07-15 00:09:42 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|