// R-UX3 Interim-UI (AD-28) — task-oriented personnel hub composed from ~/ui. // Visibility, counts and allowed actions arrive in the VM; this component has // no role names, permissions or client-side data filtering. import type { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { AppLink } from "~/components/app/AppLink"; import { FeatherArrowRight, FeatherBell, FeatherBriefcase, FeatherClipboard, FeatherLock, FeatherUser, } from "@subframe/core"; import type { HrHubItem, HrHubSection, HrHubVM } from "@hivegrid/view-models"; import { PAGE_HEADER_ICON_CLASS, PageBody, PageHeader, PageShell, } from "../shared/PageShell"; import { BadgeFeedback } from "~/ui/components/BadgeFeedback"; import { Card } from "~/ui/components/Card"; import { EmptyState } from "~/ui/components/EmptyState"; export type HrHubPageProps = { vm: HrHubVM; }; function TaskCount({ count }: { count: number }) { const { t } = useTranslation(); if (count <= 0) return null; return ( {t("hr.hub.openCount", { count })} ); } function HubItemCard({ item, priority = false }: { item: HrHubItem; priority?: boolean }) { const { t } = useTranslation(); return ( {t(item.labelKey)} {t(item.descriptionKey)} ); } function HubSectionView({ section, icon, }: { section: HrHubSection; icon: ReactNode; }) { const { t } = useTranslation(); if (!section.visible) return null; return ( {icon} {t(section.labelKey)} {t(section.descriptionKey)} {section.items.map((item) => ( ))} ); } export function HrHubPage({ vm }: HrHubPageProps) { const { t } = useTranslation(); if (!vm.moduleActive) { return ( } title={t("hr.hub.title")} subtitle={t("hr.hub.subtitle")} /> ); } return ( } title={t("hr.hub.title")} subtitle={t("hr.hub.subtitle")} actions={} /> {t("hr.hub.priority.title")} {t( vm.openTaskCount > 0 ? "hr.hub.priority.body" : "hr.hub.priority.emptyBody", )} {vm.priorityActions.map((item) => ( ))} } /> } /> } /> ); }
{t(section.descriptionKey)}
{t( vm.openTaskCount > 0 ? "hr.hub.priority.body" : "hr.hub.priority.emptyBody", )}