-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
528 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React, { Suspense } from "react"; | ||
import ProjectLoading from "./loading"; | ||
|
||
export default function ProjectLayout(props: React.PropsWithChildren) { | ||
const { children } = props; | ||
|
||
return <Suspense fallback={<ProjectLoading />}>{children}</Suspense>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ProjectSkeleton } from "./skeleton"; | ||
|
||
export default function ProjectLoading() { | ||
return <ProjectSkeleton />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Breadcrumb } from "@/components/custom/breadcrumb"; | ||
import { PageHeading } from "@/components/custom/page-heading"; | ||
import { PROJECTS_LISTING_URL } from "@/constants/routes"; | ||
import { Steps } from "./steps"; | ||
|
||
export function ProjectMainContent() { | ||
return ( | ||
<div className="flex flex-col flex-1 overflow-auto"> | ||
<PageHeading heading="Project 1" /> | ||
<Breadcrumb | ||
links={[ | ||
{ title: "All Projects", href: PROJECTS_LISTING_URL }, | ||
{ title: "Project 1" }, | ||
]} | ||
/> | ||
<Steps | ||
steps={[ | ||
{ | ||
title: "01_CP/Illumination correction", | ||
}, | ||
{ | ||
title: "02_CP/Illumination apply", | ||
}, | ||
{ | ||
title: "03_CP/Segmentation", | ||
}, | ||
{ | ||
title: "04_SBS/Illumination correction", | ||
}, | ||
]} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Suspense } from "react"; | ||
import { PageContainer } from "../../_layout/page-container"; | ||
import { ProjectMainContent } from "./main-content"; | ||
import { ProjectSkeleton } from "./skeleton"; | ||
import { getProject } from "@/services/projects"; | ||
|
||
type TProjectPageProps = { | ||
params: { | ||
id: string; | ||
}; | ||
}; | ||
|
||
export default async function ProjectPage(props: TProjectPageProps) { | ||
const { params } = props; | ||
|
||
return ( | ||
<PageContainer> | ||
<Suspense fallback={<ProjectSkeleton />}> | ||
<ProjectMainContent /> | ||
</Suspense> | ||
</PageContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { PageHeading } from "@/components/custom/page-heading"; | ||
import { Skeleton } from "@/components/ui/skeleton"; | ||
|
||
export function ProjectSkeleton() { | ||
return ( | ||
<div className=""> | ||
<div className="flex mt-3 pb-8 md:mt-6 md:border-b md:border-b-slate-200"> | ||
<Skeleton className="h-12 w-[400px]" /> | ||
</div> | ||
|
||
<div className="py-2"> | ||
<Skeleton className="h-6 w-96" /> | ||
</div> | ||
|
||
<div className="flex flex-col py-4 gap-4 md:flex-row"> | ||
<div className="space-y-3"> | ||
<Skeleton className="h-8 w-64" /> | ||
<Skeleton className="h-8 w-64" /> | ||
<Skeleton className="h-8 w-64" /> | ||
<Skeleton className="h-8 w-64" /> | ||
</div> | ||
<div className="flex-1"> | ||
<Skeleton className="h-96 w-full" /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export type TStepContent = { | ||
title: string; | ||
}; | ||
|
||
export type TStepMainAreaProps = { | ||
content: TStepContent; | ||
}; | ||
|
||
export function StepsMainArea(props: TStepMainAreaProps) { | ||
const { content } = props; | ||
|
||
return ( | ||
<div className="flex flex-col flex-1 overflow-auto"> | ||
{content.title} <br /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use client"; | ||
|
||
import { Sidebar } from "@/components/custom/sidebar"; | ||
|
||
export function StepSidebar() { | ||
return ( | ||
<Sidebar | ||
items={[ | ||
{ | ||
onClick: () => console.log("01_CP/Illumination correction"), | ||
title: "01_CP/Illumination correction", | ||
}, | ||
{ | ||
onClick: () => console.log("02_CP/Illumination apply"), | ||
title: "02_CP/Illumination apply", | ||
}, | ||
{ | ||
onClick: () => console.log("03_CP/Segmentation"), | ||
title: "03_CP/Segmentation", | ||
}, | ||
{ | ||
onClick: () => console.log("04_SBS/Illumination correction"), | ||
title: "04_SBS/Illumination correction", | ||
}, | ||
]} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { StepsMainArea } from "./steps-main-area"; | ||
import { Sidebar } from "@/components/custom/sidebar"; | ||
|
||
export type TStep = { | ||
title: string; | ||
}; | ||
|
||
export type TStepsProps = { | ||
steps: TStep[]; | ||
}; | ||
|
||
export function Steps(props: TStepsProps) { | ||
const { steps } = props; | ||
const [activeStep, setActiveStep] = React.useState(steps[0]); | ||
|
||
return ( | ||
<div className="flex flex-col py-4 gap-4 flex-1 md:flex-row md:overflow-auto"> | ||
<Sidebar | ||
items={steps.map((step) => ({ | ||
title: step.title, | ||
onClick: () => setActiveStep(step), | ||
}))} | ||
/> | ||
<StepsMainArea content={activeStep} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbPage, | ||
BreadcrumbSeparator, | ||
} from "@/components/ui/breadcrumb"; | ||
import Link from "next/link"; | ||
import React from "react"; | ||
|
||
export type TBreadcrumbLink = { | ||
href?: string; | ||
title: string; | ||
}; | ||
|
||
export type TBreadcrumbProps = { | ||
links: TBreadcrumbLink[]; | ||
}; | ||
|
||
export function Breadcrumb(props: TBreadcrumbProps) { | ||
const { links } = props; | ||
|
||
return ( | ||
<nav aria-label="breadcrumb" className="py-2"> | ||
<BreadcrumbList> | ||
{links.map(({ href, title }) => { | ||
if (!href) { | ||
return ( | ||
<BreadcrumbItem key={title}> | ||
<BreadcrumbPage>{title}</BreadcrumbPage> | ||
</BreadcrumbItem> | ||
); | ||
} | ||
|
||
return ( | ||
<React.Fragment key={title}> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink asChild> | ||
<Link href={href}>{title}</Link> | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator /> | ||
</React.Fragment> | ||
); | ||
})} | ||
</BreadcrumbList> | ||
</nav> | ||
); | ||
} |
Oops, something went wrong.