feat(silo): added in charts and historical data

This commit is contained in:
2025-04-09 17:48:03 -05:00
parent efc630f5f8
commit bad390ec17
14 changed files with 495 additions and 92 deletions

View File

@@ -0,0 +1,28 @@
import { getAdjustments } from "@/utils/querys/logistics/siloAdjustments/getAdjustments";
import { columns } from "@/utils/tableData/siloAdjustmentHist/siloAdjHist";
import { DataTable } from "@/utils/tableData/siloAdjustmentHist/siloDate";
import { useQuery } from "@tanstack/react-query";
export default function HistoricalData(props: any) {
const { data, isError, isLoading } = useQuery(getAdjustments());
if (isLoading) return <div>Loading adjustmnet data...</div>;
if (isError) {
return (
<div>
<p>There was an error getting the adjustments.</p>
</div>
);
}
//console.log(data[0].locationID, parseInt(props.laneId));
const adjustments: any = data.filter(
(l: any) => l.locationID === parseInt(props.laneId)
);
console.log(adjustments);
return (
<div className="container mx-auto py-10">
<DataTable columns={columns} data={adjustments} />
</div>
);
}