From 3a794aad983f991b79735fe8c0c2aff1cd40c215 Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw Date: Wed, 10 Jan 2024 19:18:59 +0530 Subject: [PATCH] feat(statictable): fix code smells --- .../basic/StaticTable/VerticalTable.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/basic/StaticTable/VerticalTable.tsx b/src/components/basic/StaticTable/VerticalTable.tsx index 178dfd2b..a9a569dc 100644 --- a/src/components/basic/StaticTable/VerticalTable.tsx +++ b/src/components/basic/StaticTable/VerticalTable.tsx @@ -105,9 +105,7 @@ export const VerticalTable = ({ ) } - const renderTextvalue = (text: string|undefined) => { - return text ?? '' - } + const renderTextvalue = (text: string | undefined) => text ?? '' return ( { - const value = renderTextvalue(data?.edit?.[r]?.[c].copyValue?.toString()) - await navigator.clipboard.writeText(value) - setCopied(value) - setTimeout(() => { - setCopied('') - }, 1000) + onClick={() => { + void (async () => { + const value = renderTextvalue(data?.edit?.[r]?.[c].copyValue?.toString()) + await navigator.clipboard.writeText(value) + setCopied(value) + setTimeout(() => { + setCopied('') + }, 1000) + })() }} >