Added navigations pages

This commit is contained in:
Laux Dev
2026-02-24 10:50:14 +08:00
parent 969301e80f
commit a6ae45d9cf
17 changed files with 115 additions and 8 deletions

View File

@@ -0,0 +1,7 @@
import React from "react";
const AgentsPage = () => {
return <div></div>;
};
export default AgentsPage;

View File

@@ -1,6 +1,35 @@
"use client";
import React from "react"; import React from "react";
import styles from "./styles.module.css"; import styles from "./styles.module.css";
import { usePathname, useRouter } from "next/navigation";
const Sidebar = () => { const Sidebar = () => {
const router = useRouter();
const navToHome = () => {
router.push("/home");
};
const navToOrganization = () => {
router.push("/organization");
};
const navToProject = () => {
router.push("/projects");
};
const navToUsers = () => {
router.push("/users");
};
const navToRoles = () => {
router.push("/roles");
};
const navToCredentials = () => {
router.push("/credentials");
};
const navToAgents = () => {
router.push("/agents");
};
const pathname = usePathname();
console.log(pathname);
return ( return (
<div className={styles.mainContainer}> <div className={styles.mainContainer}>
<div className={styles.topContainer}> <div className={styles.topContainer}>
@@ -61,7 +90,10 @@ const Sidebar = () => {
</div> </div>
{/* Navigations */} {/* Navigations */}
<div className={styles.navContainer}> <div className={styles.navContainer}>
<div className={styles.active}> <div
className={pathname === "/home" ? `${styles.active}` : ""}
onClick={navToHome}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -93,7 +125,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Home</p> <p>Home</p>
</div> </div>
<div> <div
className={pathname === "/organization" ? `${styles.active}` : ""}
onClick={navToOrganization}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -111,7 +146,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Organization</p> <p>Organization</p>
</div> </div>
<div> <div
className={pathname === "/projects" ? `${styles.active}` : ""}
onClick={navToProject}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -129,7 +167,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Project</p> <p>Project</p>
</div> </div>
<div> <div
className={pathname === "/users" ? `${styles.active}` : ""}
onClick={navToUsers}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -147,7 +188,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Users</p> <p>Users</p>
</div> </div>
<div> <div
className={pathname === "/roles" ? `${styles.active}` : ""}
onClick={navToRoles}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -194,7 +238,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Roles</p> <p>Roles</p>
</div> </div>
<div> <div
className={pathname === "/credentials" ? `${styles.active}` : ""}
onClick={navToCredentials}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@@ -212,7 +259,10 @@ const Sidebar = () => {
</svg> </svg>
<p>Credentials</p> <p>Credentials</p>
</div> </div>
<div> <div
className={pathname === "/agents" ? `${styles.active}` : ""}
onClick={navToAgents}
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"

View File

@@ -8,6 +8,7 @@
height: 100vh; height: 100vh;
align-self: stretch; align-self: stretch;
border-right: 1px solid #2c2d3d; border-right: 1px solid #2c2d3d;
user-select: none;
} }
.topContainer { .topContainer {
display: flex; display: flex;

View File

@@ -0,0 +1,7 @@
import React from "react";
const CredentialsPage = () => {
return <div></div>;
};
export default CredentialsPage;

View File

@@ -0,0 +1,7 @@
import React from "react";
const HomePage = () => {
return <div></div>;
};
export default HomePage;

View File

View File

@@ -1,4 +1,4 @@
import { Geist, Geist_Mono, Inter } from "next/font/google"; import { Inter } from "next/font/google";
import Sidebar from "./components/sidebar/Sidebar"; import Sidebar from "./components/sidebar/Sidebar";
import Header from "./components/header/Header"; import Header from "./components/header/Header";
import "./globals.css"; import "./globals.css";

View File

@@ -0,0 +1,14 @@
import React from "react";
import styles from "./styles.module.css";
const OrganizationPage = () => {
return (
<div>
<div className={styles.mainContainer}>
<div></div>
</div>
</div>
);
};
export default OrganizationPage;

View File

@@ -0,0 +1,7 @@
import React from "react";
const ProjectsPage = () => {
return <div></div>;
};
export default ProjectsPage;

View File

@@ -0,0 +1,7 @@
import React from "react";
const RolesPage = () => {
return <div></div>;
};
export default RolesPage;

View File

View File

@@ -0,0 +1,7 @@
import React from "react";
const UsersPage = () => {
return <div></div>;
};
export default UsersPage;

View File