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
+23
View File
@@ -0,0 +1,23 @@
// ============================================================
// hooks مواد (کالاها) — دسته‌ی جدید هم یک material است
// ============================================================
import { useMutation } from "@tanstack/react-query";
import type { Material } from "../lib/types";
import { api } from "../lib/api";
import { useAppStore } from "../store";
import { useInvalidateStore } from "./useStoreData";
export function useMaterials(): Material[] {
return useAppStore((s) => s.materials);
}
export function useAddMaterial() {
const addMaterial = useAppStore((s) => s.addMaterial);
const invalidate = useInvalidateStore();
return useMutation({
mutationFn: (m: Material) => api.materials.create(m),
onMutate: (m) => addMaterial(m),
onSettled: () => invalidate(),
});
}