Files
jsonhero-web/app/components/Properties/PropertiesNumber.tsx
T
2022-03-01 09:31:09 +00:00

27 lines
644 B
TypeScript

import { JSONFloatType, JSONIntType } from "@jsonhero/json-infer-types";
import { formatValue } from "~/utilities/formatter";
import { DataTable } from "../DataTable";
import { ValueIcon } from "../ValueIcon";
export type PropertiesNumberProps = {
type: JSONIntType | JSONFloatType;
};
export function PropertiesNumber(info: PropertiesNumberProps) {
return (
<DataTable
rows={[
{
key: "Formatted value",
value: formatValue(info.type) ?? "",
icon: <ValueIcon type={info.type} />,
},
{
key: "Type",
value: info.type.name,
},
]}
/>
);
}