feat: organize files

This commit is contained in:
TrèsAbhi committed 2024-03-12 23:36:56 -05:00
1 parent f02fb00e8c
commit f79f1ffdc3
102 files changed
+486 -502

No files matched your search

@@ -1,8 +1,8 @@
import { Stat } from '..';
import { GenericStat } from '..';
import GenericStatsRow from './GenericStatsRow';
export interface GenericStatsColumnProps {
stats: Stat[];
interface GenericStatsColumnProps {
stats: GenericStat[];
}
export default function GenericStatsColumn({ stats }: GenericStatsColumnProps) {
@@ -1,9 +1,9 @@
import { Stat } from '..';
import { GenericStat } from '..';
import { theme } from '../../../stitches.config';
import PercentileIndicator from '../../PercentileIndicator';
export interface GenericStatsRowProps {
stat: Stat;
interface GenericStatsRowProps {
stat: GenericStat;
}
export default function GenericStatsRow({ stat }: GenericStatsRowProps) {
+3 -3
View File
@@ -1,12 +1,12 @@
import { Percentile } from '../../constants/percentiles';
import GenericStatsColumn from './components/GenericStatsColumn';
export type Stat =
export type GenericStat =
| [string, string | number | undefined]
| [string, string | number | undefined, Percentile | undefined];
export interface GenericStatsProps {
stats: Stat[];
stats: GenericStat[];
columnCount?: number;
}
@@ -16,7 +16,7 @@ export default function GenericStats({
}: GenericStatsProps) {
const filteredStats = stats.filter(([, value]) => value !== undefined);
const itemsPerRow = Math.ceil(filteredStats.length / columnCount);
const columns: Stat[][] = [];
const columns: GenericStat[][] = [];
filteredStats.forEach((stat, index) => {
const column = Math.floor(index / itemsPerRow);