import { jsx } from "@emotion/react"; import { Box, Spinner, Center, RadioGroup, Radio, Stack, Divider, } from "@chakra-ui/react"; import { ErrorIndicators } from "."; import { useMemo, useState } from "react"; // const ErrorsStats = ({ data, isLoading }) => { const [tagType, setTagType] = useState("common"); const LoadingSpinner = () => (
); const highest_entropy_indicators = useMemo( () => data && Object.keys(data?.highest_entropy_tags)?.map((key) => { return { key: key, value: data?.highest_entropy_tags[key], timeseries: [...data?.errors_time_series[key]], }; }), [data] ); const most_common_indicators = useMemo( () => data && Object.keys(data?.most_common_errors)?.map((key) => { return { key: key, value: data?.most_common_errors[key], timeseries: [...data?.errors_time_series[key]], }; }), [data] ); if (isLoading || !data) return ; return ( {/* all */} highest entropy most common {tagType === "common" && ( )} {tagType === "entropy" && ( )} ); }; export default ErrorsStats;