File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
statshouse-ui/src/components2/Plot/PlotLegend Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff 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+
2331export 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" >
You can’t perform that action at this time.
0 commit comments