'use client'; import { PropsWithChildren } from 'react'; import { Box, Text } from '@chakra-ui/react'; import { TestResultContext } from '../context'; import { TestCardSkeleton } from '../Skeleton'; import { useTest, useFavoriteTests } from '#store'; interface TestRootProps { testName: string; noWrapper?: boolean; } export const TestCardRoot = ({ testName, noWrapper, children, }: PropsWithChildren) => { const testResult = useTest(testName); const { checkIsFavorite } = useFavoriteTests(); if (testResult === null) { return ( Backtest data is no longer available. ); } if (!testResult) { return ; } const isFavorite = checkIsFavorite(testResult.test.name); const getBorderColor = () => { if (noWrapper) { return 'transparent'; } if (isFavorite) { return 'yellow.800'; } return 'gray.800'; }; return ( {children} ); };