import { PageErrorState } from "@erp/core/components"; import { RdxPageContainer, RdxPageHeader, RdxPageStack } from "@repo/rdx-ui/components"; import { Skeleton } from "@repo/shadcn-ui/components"; import { Link, useNavigate } from "react-router-dom"; import { useAppTranslation } from "@/locales/i18n"; import { useHomePageController } from "../../controllers/use-home-page-controller"; import { HomeAttentionPanel } from "../blocks/home-attention-panel"; import { HomeKpiCard } from "../blocks/home-kpi-card"; import { HomeMonthlyBillingSummary } from "../blocks/home-monthly-billing-summary"; import { HomeProformaStatusSummary } from "../blocks/home-proforma-status-summary"; import { HomeRecentActivity } from "../blocks/home-recent-activity"; const HomeKpisSkeleton = () => { return (
{Array.from({ length: 4 }).map((_, index) => (
))}
); }; export const HomePage = () => { const { t } = useAppTranslation(); const navigate = useNavigate(); const ctrl = useHomePageController(); if (ctrl.hasBlockingError && ctrl.pageError) { return (
navigate("/proformas"), }} title={ctrl.pageError.title} variant="server" />
); } return ( {ctrl.customersTotalQuery.isLoading || ctrl.proformasOverviewQuery.isLoading || ctrl.monthlyBillingQuery.isLoading ? ( ) : (
{ctrl.kpis.map((kpi) => ( ))}
)}

{t("web.home.footer.note")}{" "} {t("web.home.footer.link")}

); };