1
1
import { Slider , SliderProps , Text } from '@mantine/core' ;
2
2
import { useHotkeys } from '@mantine/hooks' ;
3
3
import { ReactNode , useState } from 'react' ;
4
- import { SandboxLogRow } from '../../models.ts' ;
4
+ import { AlgorithmDataRow } from '../../models.ts' ;
5
5
import { useStore } from '../../store.ts' ;
6
6
import { formatNumber } from '../../utils/format.ts' ;
7
- import { SandboxLogDetail } from './SandboxLogDetail .tsx' ;
7
+ import { TimestampDetail } from './TimestampDetail .tsx' ;
8
8
import { VisualizerCard } from './VisualizerCard.tsx' ;
9
9
10
- export function SandboxLogsCard ( ) : ReactNode {
10
+ export function TimestampsCard ( ) : ReactNode {
11
11
const algorithm = useStore ( state => state . algorithm ) ! ;
12
12
13
- const rowsByTimestamp : Record < number , SandboxLogRow > = { } ;
14
- for ( const row of algorithm . sandboxLogs ) {
13
+ const rowsByTimestamp : Record < number , AlgorithmDataRow > = { } ;
14
+ for ( const row of algorithm . data ) {
15
15
rowsByTimestamp [ row . state . timestamp ] = row ;
16
16
}
17
17
18
- const timestampMin = algorithm . sandboxLogs [ 0 ] . state . timestamp ;
19
- const timestampMax = algorithm . sandboxLogs [ algorithm . sandboxLogs . length - 1 ] . state . timestamp ;
20
- const timestampStep = algorithm . sandboxLogs [ 1 ] . state . timestamp - algorithm . sandboxLogs [ 0 ] . state . timestamp ;
18
+ const timestampMin = algorithm . data [ 0 ] . state . timestamp ;
19
+ const timestampMax = algorithm . data [ algorithm . data . length - 1 ] . state . timestamp ;
20
+ const timestampStep = algorithm . data [ 1 ] . state . timestamp - algorithm . data [ 0 ] . state . timestamp ;
21
21
22
22
const [ timestamp , setTimestamp ] = useState ( timestampMin ) ;
23
23
@@ -35,7 +35,7 @@ export function SandboxLogsCard(): ReactNode {
35
35
] ) ;
36
36
37
37
return (
38
- < VisualizerCard title = "Sandbox logs " >
38
+ < VisualizerCard title = "Timestamps " >
39
39
< Slider
40
40
min = { timestampMin }
41
41
max = { timestampMax }
@@ -48,7 +48,7 @@ export function SandboxLogsCard(): ReactNode {
48
48
/>
49
49
50
50
{ rowsByTimestamp [ timestamp ] ? (
51
- < SandboxLogDetail row = { rowsByTimestamp [ timestamp ] } />
51
+ < TimestampDetail row = { rowsByTimestamp [ timestamp ] } />
52
52
) : (
53
53
< Text > No logs found for timestamp { formatNumber ( timestamp ) } </ Text >
54
54
) }
0 commit comments