Working on project front side.

This commit is contained in:
charles-gauthereau
2024-12-01 11:11:27 +01:00
parent 42314a9b69
commit b955d11613
19 changed files with 136 additions and 32 deletions
-7
View File
@@ -9,7 +9,6 @@ import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/
export default async function RoutePage(props: PageParams<{}>) {
const agents = await prisma.agent.findMany({})
return (
<Page>
<PageHeader>
@@ -23,11 +22,8 @@ export default async function RoutePage(props: PageParams<{}>) {
</Link>
</PageActions>
)}
</PageHeader>
<PageContent className="mt-10">
{agents.length > 0 ?
<CardsWithPagination
data={agents}
@@ -41,10 +37,7 @@ export default async function RoutePage(props: PageParams<{}>) {
className=" flex item-center justify-center border-2 border-dashed transition-colors border-primary p-8 lg:p-12 w-full rounded-md">
Create new Agent
</Link>
}
</PageContent>
</Page>
)
+1 -1
View File
@@ -2,5 +2,5 @@ import {PageParams} from "@/types/next";
import {redirect} from "next/navigation";
export default async function RoutePage(props: PageParams<{}>) {
redirect("/dashboard/agents")
redirect("/dashboard/projects")
}
@@ -0,0 +1,8 @@
import {PageParams} from "@/types/next";
export default async function RoutePage(props: PageParams<{ projectId: string }>) {
return(
<></>
)
}
@@ -3,7 +3,7 @@ import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
import {requiredCurrentUser} from "@/auth/current-user";
import {prisma} from "@/prisma";
import {notFound} from "next/navigation";
import {ProjectForm} from "@/components/wrappers/Project/ProjectForm";
import {ProjectForm} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm";
export default async function RoutePage(props: PageParams<{
@@ -1,11 +1,13 @@
import {PageParams} from "@/types/next";
import {Page, PageActions, PageContent, PageDescription, PageTitle} from "@/features/layout/page";
import {buttonVariants} from "@/components/ui/button";
import {prisma} from "@/prisma";
import {GearIcon} from "@radix-ui/react-icons";
import Link from "next/link";
import {projects} from "@/utils/mock-data";
import {ButtonDeleteProject} from "@/components/wrappers/Dashboard/Projects/ButtonDeleteProject/ButtonDeleteProject";
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
import {ProjectDatabaseCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectDatabaseCard";
import {notFound} from "next/navigation";
export default async function RoutePage(props: PageParams<{ projectId: string }>) {
@@ -21,7 +23,9 @@ export default async function RoutePage(props: PageParams<{ projectId: string }>
}
})
if(!project){
notFound()
}
return (
<Page>
@@ -34,11 +38,26 @@ export default async function RoutePage(props: PageParams<{ projectId: string }>
</Link>
</PageTitle>
<PageActions className="justify-between">
<ButtonDeleteProject
text={"Delete Project"}
/>
</PageActions>
</div>
{/*<PageDescription className="mt-5 sm:mt-0">{Project.description}</PageDescription>*/}
<PageDescription>
The list of associated databases
</PageDescription>
<PageContent className="flex flex-col w-full h-full">
{project.databases.length > 0 ?
<CardsWithPagination
data={project.databases}
cardItem={ProjectDatabaseCard}
cardsPerPage={4}
numberOfColumns={1}
extendedProps={project}
/>
:
null
}
</PageContent>
</Page>
)
@@ -1,7 +1,7 @@
import {PageParams} from "@/types/next";
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
import {prisma} from "@/prisma";
import {ProjectForm} from "@/components/wrappers/Project/ProjectForm";
import {ProjectForm} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm";
export default async function RoutePage(props: PageParams<{}>) {
+1 -1
View File
@@ -5,7 +5,7 @@ import {Button} from "@/components/ui/button";
import Link from 'next/link'
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
import {projects} from "@/utils/mock-data";
import {ProjectCard} from "@/components/wrappers/Project/ProjectCard";
import {ProjectCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectCard";
export default async function RoutePage(props: PageParams<{}>) {