Skip to content

Commit 9d0db1f

Browse files
authored
Wraps value and copy button in table row (#78)
Formats the value and copy button within a table row structure to better align with the intended layout of the span details panel. This change improves the visual presentation and responsiveness of the value display and copy functionality.
1 parent 00244a2 commit 9d0db1f

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/components/Span/SpanDetailsPanel.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,27 @@ function ValueWrapper({
113113
}) {
114114
const [tooltip, setTooltip] = useState('Copy value');
115115
return (
116-
<span className={`flex gap-1 items-center justify-between ${italic ? 'italic' : ''}`}>
117-
<span className={`p-2 ${color}`}>{displayValue || value}</span>
118-
<IconButton
119-
name="copy"
120-
variant="secondary"
121-
aria-label="Copy value"
122-
className="bg-red-500"
123-
tooltip={tooltip}
124-
onClick={() => {
125-
navigator.clipboard.writeText(value || '');
126-
setTooltip((_) => 'Copied!');
127-
setTimeout(() => {
128-
setTooltip((_) => 'Copy value');
129-
}, 1000);
130-
}}
131-
/>
132-
</span>
116+
<tr>
117+
<td className={`max-w-[1px] w-full ${italic ? 'italic' : ''}`}>
118+
<span className={`block truncate p-2 ${color}`}>{displayValue || value}</span>
119+
</td>
120+
<td>
121+
<IconButton
122+
name="copy"
123+
variant="secondary"
124+
aria-label="Copy value"
125+
className="bg-red-500"
126+
tooltip={tooltip}
127+
onClick={() => {
128+
navigator.clipboard.writeText(value || '');
129+
setTooltip((_) => 'Copied!');
130+
setTimeout(() => {
131+
setTooltip((_) => 'Copy value');
132+
}, 1000);
133+
}}
134+
/>
135+
</td>
136+
</tr>
133137
);
134138
}
135139

0 commit comments

Comments
 (0)