feat(frontend): add React UI — procurement office, wizard, suppliers, inventory panel (dash port), role-based login

This commit is contained in:
ali_mohaghegh
2026-08-25 19:08:15 +03:30
parent 170aed66ea
commit 4e105c5cd5
103 changed files with 16352 additions and 0 deletions
@@ -0,0 +1,40 @@
import { useMemo } from "react";
import { useStoreData, useSuppliers } from "../../hooks";
import { normalize } from "../../lib/normalize";
import { TOPICS } from "../../lib/constants";
import { Header, PageLayout } from "../../components/layout/Header";
import { TopicGrid } from "../../components/TopicGrid";
import { useNavigate } from "react-router-dom";
// صفحه‌ی تأمین‌کننده‌ها — انتخاب موضوع
export function SuppliersPage() {
useStoreData();
const suppliers = useSuppliers();
const navigate = useNavigate();
const counts = useMemo(() => {
const out: Record<string, number> = {};
TOPICS.forEach((t) => {
out[t.name] = suppliers.filter((s) => normalize(s.topic) === normalize(t.name)).length;
});
return out;
}, [suppliers]);
return (
<div className="min-h-screen">
<Header
title="تأمین‌کننده‌ها"
sub="اول موضوع (دسته‌بندی) را انتخاب کنید"
backTo="/"
backLabel="بازگشت به دفتر"
/>
<PageLayout>
<TopicGrid
onSelect={(topic) => navigate(`/topics/${encodeURIComponent(topic)}`)}
showCounts
counts={counts}
/>
</PageLayout>
</div>
);
}