import { formatMm, formatPercentage } from 'shared/utils.mjs' import { ListValue, HighlightedValue, PlainValue } from '../shared/values' export const PctOptionValue = ({ config, current, settings, changed }) => { const val = changed ? current : config.pct / 100 return ( {formatPercentage(val)} {config.toAbs && settings.measurements ? ` | ${formatMm(config.toAbs(val, settings))}` : null} ) } export const BoolOptionValue = ({ config, current, t, changed }) => ( ) export const CountOptionValue = ({ config, current, changed }) => ( ) export const ListOptionValue = ({ name, config, current, t, changed }) => { const translate = config.doNotTranslate ? (input) => input : (input) => t(`${name}.o.${input}`) const value = translate(changed ? current : config.dflt) return {value} } export const DegOptionValue = ({ config, current, changed }) => ( {changed ? current : config.deg}° ) export const MmOptionValue = () => ( FIXME: No MmOptionvalue implemented ) export const ConstantOptionValue = () => ( FIXME: No ConstantOptionvalue implemented )