File size: 470 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { useMemo } from 'react'
import { TableTooltip, Chip } from '@nivo/tooltip'
import { StackTooltipProps } from './types'

export const StackTooltip = ({ slice }: StackTooltipProps) => {
    const rows = useMemo(
        () =>
            slice.stack.map(p => [
                <Chip key={p.layerId} color={p.color} />,
                p.layerLabel,
                p.formattedValue,
            ]),
        [slice]
    )

    return <TableTooltip rows={rows} />
}