diff --git a/frontend/app/projects/[id]/page.tsx b/frontend/app/projects/[id]/folders/page.tsx similarity index 71% rename from frontend/app/projects/[id]/page.tsx rename to frontend/app/projects/[id]/folders/page.tsx index f0490a0..dbdbc06 100644 --- a/frontend/app/projects/[id]/page.tsx +++ b/frontend/app/projects/[id]/folders/page.tsx @@ -2,8 +2,8 @@ import { useEffect, useState } from "react"; import Config from "@/config/config"; const apiServer = Config.apiServer; -import Main from "./main"; -import Sidebar from "./sidebar"; +import { Listbox, ListboxItem } from "@nextui-org/react"; +import { FolderIcon } from "@/components/icons"; /** * fetch folder records @@ -50,21 +50,19 @@ export default function Page({ params }: { params: { id: string } }) { }, []); return ( - <> - {/*
Project: {params.id}
-
+
+ {folders.map((folder, index) => ( -
-
{folder.name}
-
{folder.detail}
-
{folder.projectId}
-
+ } + > + {folder.name} + {/* {folder.detail} + {folder.projectId} */} + ))} -
*/} -
- -
-
- + +
); } diff --git a/frontend/app/projects/[id]/home/page.tsx b/frontend/app/projects/[id]/home/page.tsx new file mode 100644 index 0000000..f55192f --- /dev/null +++ b/frontend/app/projects/[id]/home/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return <>This is Home tab; +} diff --git a/frontend/app/projects/[id]/layout.tsx b/frontend/app/projects/[id]/layout.tsx index 7259ddf..deaf7c1 100644 --- a/frontend/app/projects/[id]/layout.tsx +++ b/frontend/app/projects/[id]/layout.tsx @@ -1,7 +1,18 @@ +import Sidebar from "./sidebar"; + export default function ProjectsLayout({ children, }: { children: React.ReactNode; }) { - return <>{children}; + return ( + <> +
+ +
+
{children}
+
+
+ + ); } diff --git a/frontend/app/projects/[id]/main.tsx b/frontend/app/projects/[id]/main.tsx deleted file mode 100644 index 31053cf..0000000 --- a/frontend/app/projects/[id]/main.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; - -export default function Main() { - return ( -
-
- aaa -
-
- ); -} diff --git a/frontend/app/projects/[id]/runs/page.tsx b/frontend/app/projects/[id]/runs/page.tsx new file mode 100644 index 0000000..9624f12 --- /dev/null +++ b/frontend/app/projects/[id]/runs/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return <>This is Runs tab; +} diff --git a/frontend/app/projects/[id]/sidebar.tsx b/frontend/app/projects/[id]/sidebar.tsx index cfb5811..83942a1 100644 --- a/frontend/app/projects/[id]/sidebar.tsx +++ b/frontend/app/projects/[id]/sidebar.tsx @@ -1,17 +1,32 @@ +"use client"; import { Menu, MenuItem } from "@nextui-org/react"; import { HomeIcon, PagesIcon, PlayIcon } from "@/components/icons"; +import { useRouter } from "next/navigation"; export default function Sidebar() { + const router = useRouter(); return (
- } className="p-3"> + } + className="p-3" + onClick={() => router.push("/projects/1/home")} + > Home - } className="p-3"> + } + className="p-3" + onClick={() => router.push("/projects/1/folders")} + > Test Cases - } className="p-3"> + } + className="p-3" + onClick={() => router.push("/projects/1/runs")} + > Test Runs diff --git a/frontend/app/projects/project-card.tsx b/frontend/app/projects/project-card.tsx index e4b2ae9..41d22b0 100644 --- a/frontend/app/projects/project-card.tsx +++ b/frontend/app/projects/project-card.tsx @@ -10,7 +10,7 @@ import NextLink from "next/link"; export function ProjectCard({ projectName, projectDetail }) { return ( - + = ({ ); }; + +export const FolderIcon: React.FC = ({ + size = 24, + width, + height, + ...props +}) => { + return ( + + + + ); +};