Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/beximco/mrp_process/src/pages/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { useNavigate, Link } from "react-router-dom";
import { useContext } from "react";
import AuthContext from "./AuthProvider";
import useAuth from "./useAuth";
const Homes = () => {
const { setAuth } = useContext(AuthContext);
const { auth } = useAuth();
const navigate = useNavigate();
console.log(auth);
const logout = async () => {
// if used in more components, this should be in context
// axios to /logout endpoint
setAuth({});
navigate("/login");
};
return (
<section className="section">
<div className="container">
<div className="row">
<div className="col mt-4 pt-2">
<div className="component-wrapper rounded shadow">
<div className="p-4 border-bottom">
<h4 className="title mb-0">Stages</h4>
</div>
<div className="p-2">
<Link
to="/creel"
className="btn btn-pills btn-primary mt-2 mr-1 ml-3 mb-3"
>
Stage 1
</Link>
<Link
to="/beam-creel"
className="btn btn-pills btn-secondary mt-2 mr-1 mb-3"
>
Stage 2
</Link>
<Link
to="/weaving-loom"
className="btn btn-pills btn-success mt-2 mr-1 mb-3"
>
Stage 3
</Link>
<Link
to="/fabric-inspection"
className="btn btn-pills btn-danger mt-2 mr-1 ml-3 mb-3"
>
Stage 4
</Link>
<Link
to="/seinging"
className="btn btn-pills btn-info mt-2 mr-1 mb-3"
>
Stage 5
</Link>
<Link
to="/finishing-rolls"
className="btn btn-pills btn-warning mt-2 mr-1 mb-3"
>
Stage 6
</Link>
<Link
to="/inventory"
className="btn btn-pills btn-dark mt-2 mr-4 ml-3 mb-3"
>
Inventory
</Link>
<button
className="btn btn-pills btn-primary mt-2 ml-4 mb-3"
onClick={logout}
>
Logout
</button>
</div>
</div>
</div>
</div>
</div>
</section>
);
};
export default Homes;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0073 ]-- |