Skip to content

Commit

Permalink
feat(statictable): fix code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw committed Jan 10, 2024
1 parent 7bc649b commit 3a794aa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/basic/StaticTable/VerticalTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ export const VerticalTable = ({
)
}

const renderTextvalue = (text: string|undefined) => {
return text ?? ''
}
const renderTextvalue = (text: string | undefined) => text ?? ''

return (
<table
Expand Down Expand Up @@ -186,13 +184,15 @@ export const VerticalTable = ({
color: copied === data?.edit?.[r]?.[c].copyValue ? '#00cc00' : '#cccccc',
},
}}
onClick={async () => {
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)
})()
}}
>
<ContentCopyIcon
Expand Down

0 comments on commit 3a794aa

Please sign in to comment.