import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { CalendarClock, CalendarX2, FolderCheck, SquareSigma, Workflow } from "lucide-react"; import { Statistic } from "@/domain/domain"; import { get } from "@/api/statistics"; import CertificateList from "@/components/certificate/CertificateList"; const Dashboard = () => { const [statistic, setStatistic] = useState(); const { t } = useTranslation(); useEffect(() => { const fetchStatistic = async () => { const data = await get(); setStatistic(data); }; fetchStatistic(); }, []); return (
{t("dashboard.page.title")}
{t("dashboard.statistics.all.certificate")}
{statistic?.certificateTotal ? ( {statistic?.certificateTotal} ) : ( 0 )}
{t("dashboard.statistics.unit")}
{t("dashboard.statistics.near_expired.certificate")}
{statistic?.certificateExpireSoon ? ( {statistic?.certificateExpireSoon} ) : ( 0 )}
{t("dashboard.statistics.unit")}
{t("dashboard.statistics.expired.certificate")}
{statistic?.certificateExpired ? ( {statistic?.certificateExpired} ) : ( 0 )}
{t("dashboard.statistics.unit")}
{t("dashboard.statistics.all.workflow")}
{statistic?.workflowTotal ? ( {statistic?.workflowTotal} ) : ( 0 )}
{t("dashboard.statistics.unit")}
{t("dashboard.statistics.enabled.workflow")}
{statistic?.workflowEnabled ? ( {statistic?.workflowEnabled} ) : ( 0 )}
{t("dashboard.statistics.unit")}

{t("dashboard.certificate")}
); }; export default Dashboard;