Repository navigation
Expand file tree
/
Copy pathcomponents.ts
More file actions
59 lines (51 loc) · 1.41 KB
/
Copy pathcomponents.ts
File metadata and controls
59 lines (51 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { ReactNode } from 'react';
import { ChartDataPoint } from './api';
// Base component props
export interface BaseComponentProps {
className?: string;
children?: ReactNode;
}
// Chart component props
export interface ChartProps extends BaseComponentProps {
data: ChartDataPoint[];
selectedBenchmarks: string[];
selectedMetric: 'high_watermark_bytes' | 'total_allocated_bytes';
colors: string[];
height?: number;
yAxisDomain?: [number, number];
}
// Data table component props
export interface DataTableColumn<T> {
key: keyof T;
label: string;
sortable?: boolean;
formatter?: (value: any, row: T) => ReactNode;
className?: string;
}
export interface DataTableProps<T extends Record<string, any>>
extends BaseComponentProps {
data: T[];
columns: DataTableColumn<T>[];
searchable?: boolean;
searchPlaceholder?: string;
searchFields?: (keyof T)[];
filterable?: boolean;
pageSize?: number;
}
// Page component props
export interface TrendsPageProps {
initialBinaryId?: string;
initialEnvironmentId?: string;
}
export interface DiffPageProps {
initialBinaryId?: string;
initialEnvironmentId?: string;
initialCommitSha?: string;
}
export interface BuildComparisonPageProps {
initialBinaries?: string[];
initialEnvironmentId?: string;
}
// Metric and utility types
export type MetricKey = 'high_watermark_bytes' | 'total_allocated_bytes';
export type SortDirection = 'asc' | 'desc';