feat: legacy

This commit is contained in:
TrèsAbhi committed 2024-09-14 12:12:46 -05:00
1 parent 9640920863
commit 8d9ca3d716
271 files changed
+1 -1

No files matched your search

@@ -0,0 +1,31 @@
import { Skeleton, Table } from '@radix-ui/themes';
import { times } from 'lodash';
import { memo, useRef } from 'react';
import { useIntersection } from '../../../../hooks/useIntersection';
import { TankPerformanceSortTypeNamesArray } from '../../../../stores/tankPerformanceSort/constants';
interface RowLoaderProps {
onIntersection?: () => void;
}
export const RowLoader = memo<RowLoaderProps>(({ onIntersection }) => {
const row = useRef<HTMLTableRowElement>(null);
useIntersection(() => onIntersection?.(), row, {
disabled: onIntersection === undefined,
});
return (
<Table.Row ref={row}>
<Table.RowHeaderCell align="center">
<Skeleton height="100%" width="128px" />
</Table.RowHeaderCell>
{times(TankPerformanceSortTypeNamesArray.length, (index) => (
<Table.Cell key={index} align="center">
<Skeleton height="1em" width="32px" />
</Table.Cell>
))}
</Table.Row>
);
});