fix(projects): enable bulk backup/restore selection on project page

This commit is contained in:
Charles GTE
2026-07-05 13:50:33 +02:00
parent fe1d077754
commit 96c51a08c6
@@ -3,6 +3,7 @@ import { Page, PageContent, PageTitle } from "@/features/layout/components/page"
import { ButtonDeleteProject } from "@/features/projects/components/project-delete-button"; import { ButtonDeleteProject } from "@/features/projects/components/project-delete-button";
import { CardsWithPagination } from "@/components/common/cards-with-pagination"; import { CardsWithPagination } from "@/components/common/cards-with-pagination";
import { ProjectDatabaseCard } from "@/features/projects/components/project-database-card"; import { ProjectDatabaseCard } from "@/features/projects/components/project-database-card";
import { ProjectDatabaseSelection } from "@/features/projects/components/project-database-selection";
import { notFound, redirect } from "next/navigation"; import { notFound, redirect } from "next/navigation";
import { db } from "@/db"; import { db } from "@/db";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
@@ -87,6 +88,7 @@ export default async function RoutePage(
</div> </div>
<PageContent className="flex flex-col w-full h-full"> <PageContent className="flex flex-col w-full h-full">
{proj.databases.length > 0 ? ( {proj.databases.length > 0 ? (
isMember ? (
<CardsWithPagination <CardsWithPagination
data={[...proj.databases].sort( data={[...proj.databases].sort(
(a, b) => (a, b) =>
@@ -101,6 +103,12 @@ export default async function RoutePage(
pageSizeOptions={[10, 20, 50]} pageSizeOptions={[10, 20, 50]}
extendedProps={proj} extendedProps={proj}
/> />
) : (
<ProjectDatabaseSelection
projectId={proj.id}
databases={proj.databases}
/>
)
) : ( ) : (
<div className="flex flex-col items-center justify-center h-full text-muted-foreground py-20"> <div className="flex flex-col items-center justify-center h-full text-muted-foreground py-20">
<p className="text-lg font-medium">No databases found</p> <p className="text-lg font-medium">No databases found</p>