Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+79
@@ -0,0 +1,79 @@
|
||||
// AK-P17b Interim-UI (AD-28) — employee payslips composed from ~/ui (D-HR
|
||||
// "Lohnabrechnungen", archetype A2). Pure presentational: own list; opening a
|
||||
// payslip is audited server-side and returns the File id (route opens it). Final
|
||||
// Subframe optics = tracked design-nachzug.
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FeatherExternalLink } from "@subframe/core";
|
||||
import type { HrPayslipOwnVM } from "@hivegrid/view-models";
|
||||
import { BadgeFeedback } from "~/ui/components/BadgeFeedback";
|
||||
import { Button } from "~/ui/components/Button";
|
||||
import { EmptyState } from "~/ui/components/EmptyState";
|
||||
import { Table } from "~/ui/components/Table";
|
||||
|
||||
export type HrPayslipsActions = { onOpen: (payslipId: string) => void };
|
||||
|
||||
export type HrPayslipsPageProps = {
|
||||
vm: HrPayslipOwnVM;
|
||||
submitting: boolean;
|
||||
actions: HrPayslipsActions;
|
||||
};
|
||||
|
||||
export function HrPayslipsPage({ vm, submitting, actions }: HrPayslipsPageProps) {
|
||||
const { t } = useTranslation();
|
||||
const rows = vm.data?.rows ?? [];
|
||||
|
||||
if (vm.status !== "ready" || !vm.data) {
|
||||
return <div className="flex w-full flex-col gap-6 p-6" data-ui-id="ui.hr.payslips" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex w-full flex-col gap-6 p-6" data-ui-id="ui.hr.payslips">
|
||||
<div className="flex flex-col gap-0">
|
||||
<span className="text-heading-2 font-heading-2 text-text-neutral-primary">{t("hr.payslips.title")}</span>
|
||||
<span className="text-body-default-regular-150 font-body-default-regular-150 text-text-neutral-secondary">{t("hr.payslips.subtitle")}</span>
|
||||
</div>
|
||||
|
||||
{rows.length === 0 ? (
|
||||
<div data-ui-id="ui.hr.payslips.empty">
|
||||
<EmptyState title={t("hr.payslips.own.empty.headline")} body={t("hr.payslips.own.empty.body")} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-full overflow-x-auto">
|
||||
<Table
|
||||
data-ui-id="ui.hr.payslips.list"
|
||||
header={
|
||||
<Table.HeaderRow>
|
||||
<Table.HeaderCell>{t("hr.payslips.column.period")}</Table.HeaderCell>
|
||||
<Table.HeaderCell> </Table.HeaderCell>
|
||||
<Table.HeaderCell> </Table.HeaderCell>
|
||||
</Table.HeaderRow>
|
||||
}
|
||||
>
|
||||
{rows.map((row) => (
|
||||
<Table.Row key={row.id} data-row-id={row.id} data-read={row.isRead}>
|
||||
<Table.Cell>
|
||||
<span className="text-body-default-medium-0 font-body-default-medium-0 text-text-neutral-primary">{row.periodLabel}</span>
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
{!row.isRead ? (
|
||||
<BadgeFeedback farbe="subtle-warning" size="small">
|
||||
{t("hr.payslips.unread")}
|
||||
</BadgeFeedback>
|
||||
) : null}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
<div className="flex justify-end">
|
||||
<Button variant="tertiary" size="small" icon={<FeatherExternalLink />} loading={submitting} onClick={() => actions.onOpen(row.id)}>
|
||||
{t("hr.payslips.action.open")}
|
||||
</Button>
|
||||
</div>
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user