import StatisticContainer from "@/pages/Statistics/components/StatisticContainer"; import {t} from "i18next"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {faCircleExclamation, faGaugeHigh, faStopwatch} from "@fortawesome/free-solid-svg-icons"; import "./styles.sass"; export const OverviewChart = (props) => { const formatDateForTitle = (date) => { return date.toLocaleDateString(undefined, { day: "2-digit", month: "short" }); }; const title = t("test.overview.title_range", { from: formatDateForTitle(props.dateRange.from), to: formatDateForTitle(props.dateRange.to) }); const items = [ { icon: faGaugeHigh, title: "statistics.overview.total_title", description: "statistics.overview.total_description", value: props.tests.total }, { icon: faCircleExclamation, title: "statistics.overview.failed_title", description: "statistics.overview.failed_description", value: props.tests.failed }, { icon: faStopwatch, title: "statistics.overview.average_title", description: "statistics.overview.average_description", value: props.time.avg + "s" } ]; return (
{items.map((item, index) => (

{t(item.title)}

{t(item.description)}

{item.value}

))}
); }