mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Style scrollbars.
This commit is contained in:
parent
14802afe8b
commit
17601c4dea
8 changed files with 56 additions and 15 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { useState } from 'react';
|
||||
import useMeasure from 'react-use-measure';
|
||||
import { FixedSizeList } from 'react-window';
|
||||
import { useSpring, animated, config } from 'react-spring';
|
||||
import classNames from 'classnames';
|
||||
|
|
@ -18,6 +19,7 @@ export default function DataTable({
|
|||
virtualize = false,
|
||||
showPercentage = true,
|
||||
}) {
|
||||
const [ref, bounds] = useMeasure();
|
||||
const [format, setFormat] = useState(true);
|
||||
const formatFunc = format ? formatLongNumber : formatNumber;
|
||||
|
||||
|
|
@ -56,10 +58,10 @@ export default function DataTable({
|
|||
{metric}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.body} style={{ height }}>
|
||||
<div ref={ref} className={styles.body}>
|
||||
{data?.length === 0 && <NoData />}
|
||||
{virtualize && data.length > 0 ? (
|
||||
<FixedSizeList height={height} itemCount={data.length} itemSize={30}>
|
||||
<FixedSizeList height={bounds.height} itemCount={data.length} itemSize={30}>
|
||||
{Row}
|
||||
</FixedSizeList>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue