diff --git a/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatJsonParse.tsx b/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatJsonParse.tsx index ac6b749640..6e48c76fda 100644 --- a/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatJsonParse.tsx +++ b/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatJsonParse.tsx @@ -5,10 +5,14 @@ import type { ICompactTableFormatterProps } from './types'; export const FormatJsonParse = () => { const Component = ({ value }: ICompactTableFormatterProps) => { - const valueString = typeof value === 'string' ? JSON.parse(value) : value; + let v = value; + if (typeof value === 'string') { + v = !!value && value?.length > 0 ? JSON.parse(value) : value; + } + return ( - {!!value && value?.length > 0 ? JSON.parse(valueString) : value} + {v} ); }; diff --git a/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatMultiStepTx.tsx b/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatMultiStepTx.tsx index c807ae2c7a..abe0756f81 100644 --- a/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatMultiStepTx.tsx +++ b/packages/libs/kode-ui/src/patterns/CompactTable/TableFormatters/FormatMultiStepTx.tsx @@ -1,10 +1,13 @@ import { MonoAirlineStops } from '@kadena/kode-icons/system'; import React from 'react'; import type { ICompactTableFormatterProps } from './types'; +import { valueToString } from './utils'; export const FormatMultiStepTx = () => { const Component = ({ value }: ICompactTableFormatterProps) => { - return value ? : undefined; + return valueToString(value) ? ( + + ) : undefined; }; return Component; };