Skip to content

Commit

Permalink
StatsHouse UI: feature copy max host
Browse files Browse the repository at this point in the history
  • Loading branch information
vauweb committed Jan 17, 2025
1 parent 7075282 commit cc4d018
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ type PlotLegendMaxHostProps = {
idx: number;
};

function copyItem(value?: string | string[]) {
if (typeof value === 'string') {
window.navigator.clipboard.writeText(value).then(() => {
debug.log(`clipboard ${value}`);
});
}
}

export const PlotLegendMaxHost = memo(function PlotLegendMaxHost({
value,
placeholder,
Expand All @@ -34,14 +42,6 @@ export const PlotLegendMaxHost = memo(function PlotLegendMaxHost({
});
}, [idx, maxHostLists]);

const copyItem = useCallback((value?: string | string[]) => {
if (typeof value === 'string') {
window.navigator.clipboard.writeText(value).then(() => {
debug.log(`clipboard ${value}`);
});
}
}, []);

const options = useMemo(() => maxHostLists[idx - 1] ?? [], [idx, maxHostLists]);
return (
<div className="d-flex flex-nowrap">
Expand Down

0 comments on commit cc4d018

Please sign in to comment.