Skip to content

Commit cc4d018

Browse files
committed
StatsHouse UI: feature copy max host
1 parent 7075282 commit cc4d018

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

statshouse-ui/src/components2/Plot/PlotLegend/PlotLegendMaxHost.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ type PlotLegendMaxHostProps = {
2020
idx: number;
2121
};
2222

23+
function copyItem(value?: string | string[]) {
24+
if (typeof value === 'string') {
25+
window.navigator.clipboard.writeText(value).then(() => {
26+
debug.log(`clipboard ${value}`);
27+
});
28+
}
29+
}
30+
2331
export const PlotLegendMaxHost = memo(function PlotLegendMaxHost({
2432
value,
2533
placeholder,
@@ -34,14 +42,6 @@ export const PlotLegendMaxHost = memo(function PlotLegendMaxHost({
3442
});
3543
}, [idx, maxHostLists]);
3644

37-
const copyItem = useCallback((value?: string | string[]) => {
38-
if (typeof value === 'string') {
39-
window.navigator.clipboard.writeText(value).then(() => {
40-
debug.log(`clipboard ${value}`);
41-
});
42-
}
43-
}, []);
44-
4545
const options = useMemo(() => maxHostLists[idx - 1] ?? [], [idx, maxHostLists]);
4646
return (
4747
<div className="d-flex flex-nowrap">

0 commit comments

Comments
 (0)