From afc961fc471c1faea9de45591060344c49867cfd Mon Sep 17 00:00:00 2001 From: Steven Straatemans Date: Thu, 7 Nov 2024 13:35:50 +0100 Subject: [PATCH] fix builds --- .../CompactTable/TableFormatters/FormatJsonParse.tsx | 8 ++++++-- .../CompactTable/TableFormatters/FormatMultiStepTx.tsx | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) 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; };