'use client';
import { SimpleGrid, Stat, Card, Heading } from '@chakra-ui/react';
import { getFormatted } from '@tradejs/core/backtest';
import { useTestContext } from '../context';
import { ThresholdLevel, TestThresholdsKey } from '@tradejs/types';
const getColorByLevel = (level: ThresholdLevel) => {
switch (level) {
case 'success':
return 'teal.500';
case 'warning':
return 'fg.warning';
case 'neutral':
return 'gray.300';
case 'error':
default:
return 'fg.error';
}
};
interface StatItemProps {
id: TestThresholdsKey;
size?: 'sm' | 'md' | 'lg';
title: string;
}
const StatItem = ({ id, title, size = 'md' }: StatItemProps) => {
const {
testResult: { stat },
} = useTestContext();
const { formatted, level } = getFormatted(stat, id);
return (
{title}
{formatted}
);
};
export const TestCardStatLine = () => {
return (
);
};
export const TestCardStatTable = () => {
return (
<>
Period & Activity
Performance
Risk & Risk-Adjusted
Trade Quality & Consistency
>
);
};