{"version":3,"file":"ViewUnitCell.cjs","sources":["../../../../../src/lib/DataTable/cells/ViewUnitCell.tsx"],"sourcesContent":["import type {FC, ComponentProps} from 'react';\n\nimport type {UnitDisplayModes} from '@/lib/Number';\nimport {NumberUnit} from '@/lib/Number';\nimport type {Locale, Units} from '@/internal/locale';\n\nimport classes from './Cells.module.css';\nimport type {CellComponent} from './../types.ts';\n\nexport type Props = ComponentProps<CellComponent> & {\n    unit?: keyof typeof Units;\n    unitDisplay?: keyof typeof UnitDisplayModes;\n};\n\nexport const ViewUnitCell: FC<Props> = ({value, cellContext, unit, ...restProps}) => {\n    const locale = cellContext.table.options.meta?.locale as Locale;\n    return (\n        <div className={classes.viewNumberCell}>\n            <NumberUnit {...restProps} unit={unit} locale={locale} value={Number(value)} />\n        </div>\n    );\n};\n"],"names":["ViewUnitCell","value","cellContext","unit","restProps","locale","jsx","classes","NumberUnit"],"mappings":"+MAcaA,EAA0B,CAAC,CAAC,MAAAC,EAAO,YAAAC,EAAa,KAAAC,EAAM,GAAGC,KAAe,CACjF,MAAMC,EAASH,EAAY,MAAM,QAAQ,MAAM,OAC/C,OACII,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAAA,QAAQ,eACpB,SAAAD,MAACE,EAAAA,WAAA,CAAY,GAAGJ,EAAW,KAAAD,EAAY,OAAAE,EAAgB,MAAO,OAAOJ,CAAK,EAAG,EACjF,CAER"}