test(silos): more base line silo data to be implemented

This commit is contained in:
2025-04-08 06:43:56 -05:00
parent 9deedd86e5
commit 4371fcc028
4 changed files with 479 additions and 65 deletions

View File

@@ -0,0 +1,31 @@
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/(logistics)/siloAdjustments/$hist")({
component: RouteComponent,
beforeLoad: async () => {
const auth = localStorage.getItem("auth_token");
if (!auth) {
throw redirect({
to: "/login",
search: {
// Use the current location to power a redirect after login
// (Do not use `router.state.resolvedLocation` as it can
// potentially lag behind the actual current location)
redirect: location.pathname + location.search,
},
});
}
},
// In a loader
loader: ({ params }) => params.hist,
// Or in a component
});
function RouteComponent() {
return (
<div>
Hello "/(logistics)/siloAdjustments/$hist"! where the historical
data will be shown in a table alone with a graph
</div>
);
}