feat(siloadjustments): added email for comments :D

This commit is contained in:
2025-04-04 22:09:47 -05:00
parent 9f26f2334f
commit f1abe7b33d
24 changed files with 8565 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import Comment from "@/components/logistics/siloAdjustments/Comment";
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute(
"/(logistics)/siloAdjustments/comment/$comment"
)({
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.comment,
// Or in a component
component: RouteComponent,
});
function RouteComponent() {
const { comment } = Route.useParams();
return (
<div className="ml-20 mt-20">
<Comment id={comment} />
</div>
);
}