feat(cards): migrated cards over

This commit is contained in:
2025-04-14 12:26:31 -05:00
parent 328b61f6cc
commit 087d14c585
21 changed files with 1318 additions and 334 deletions

View File

@@ -1,68 +1,74 @@
import { useCardStore } from "@/lib/store/useCardStore";
import INVCheckCard from "../logistics/warehouse/InventoryCard";
import PPOO from "../logistics/warehouse/PPOOCard";
const componentsMap: any = {
ppoo: PPOO,
inv: INVCheckCard,
//QualityRequest,
};
export default function DashBoard() {
// const handleResizeStop = (newLayout: any, newItem: any) => {
// updateCard(
// newItem.i,
// newLayout.filter((n: any) => n.i === newItem.i)[0]
// ); // Store the new layout in state
// };
// const handleDragStop = (newLayout: any, newItem: any) => {
// updateCard(
// newItem.i,
// newLayout.filter((n: any) => n.i === newItem.i)[0]
// ); // Persist the updated layout with custom name
// };
const { cards } = useCardStore();
//console.log(cards);
return (
<div className="ml-5 w-11/12 h-9/10">
<p>Comming soon...</p>
{/* <ResizablePanelGroup
direction="horizontal"
//className="rounded-lg border"
autoSaveId="persistence"
>
<ResizablePanel>
<ResizablePanelGroup direction="vertical">
<ResizablePanel>
<div className="overflow: auto">
<Lots />
</div>
</ResizablePanel>
<ResizableHandle />
<ResizablePanel>
<ResizablePanelGroup direction="horizontal">
<ResizablePanel>
<LabelLog />
</ResizablePanel>
<ResizableHandle />
<ResizablePanel>
<OcpLogs />
</ResizablePanel>
</ResizablePanelGroup>
</ResizablePanel>
</ResizablePanelGroup>
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={25}>
<ResizablePanelGroup direction="vertical">
{server[0].value === "usday1vms006" && (
<ResizablePanel className="max-h-[300px]">
<WrapperManualTrigger />
</ResizablePanel>
)}
{server[0].value === "usday1vms006" && (
<ResizablePanel className="max-h-[300px]">
<WrapperManualTrigger />
</ResizablePanel>
)}
<div className="ml-5 w-11/12 h-9/10 grid grid-cols-12 gap-1">
{cards.map((a: any) => {
const name = a.name; //.filter((c) => c.i === card.i)[0].i || "name";
<ResizableHandle />
<ResizablePanel>
<PrinterStatus />
</ResizablePanel>
</ResizablePanelGroup>
</ResizablePanel>
</ResizablePanelGroup> */}
const Component = componentsMap[name.split("-")[0]];
return (
<div key={a.name} className="col-span-3">
<Component age={a.age} type={a.rowType} />{" "}
</div>
);
})}
</div>
);
// return (
// <div className="ml-5 w-11/12 h-9/10 grid grid-cols-12 gap-1">
// <div className="col-span-3">
// <PPOO />
// </div>
// <div className="col-span-3">
// <INVCheckCard age={90} type={"empty"} />
// </div>
// <div className="col-span-3">
// <INVCheckCard age={75} type={"fg"} />
// </div>
// <div className="col-span-3">
// <INVCheckCard age={30} type={"materials"} />
// </div>
// <div className="col-span-3">
// <INVCheckCard age={7} type={"waste"} />
// </div>
// <div className="col-span-3">
// <INVCheckCard age={7} type={"packaging"} />
// </div>
// </div>
// );
}
/*
<div className="col-span-3">
<PPOO />
</div>
<div className="col-span-3">
<INVCheckCard age={30} type={"empty"} />
</div>
<div className="col-span-3">
<INVCheckCard age={30} type={"fg"} />
</div>
<div className="col-span-3">
<INVCheckCard age={30} type={"materials"} />
</div>
<div className="col-span-3">
<INVCheckCard age={30} type={"waste"} />
</div>
<div className="col-span-3">
<INVCheckCard age={30} type={"packaging"} />
</div>
*/