zerobyte/app/routes/(dashboard)/repositories/$repositoryId/$snapshotId/index.tsx
Nico 8fcd446926
refactor: snapshot strip out base path (#542)
* refactor: strip out volume path in snapshot list / restore

chore: lint issue

* test: backups new include patterns
2026-02-18 21:45:19 +01:00

37 lines
1.2 KiB
TypeScript

import { createFileRoute } from "@tanstack/react-router";
import { getRepositoryOptions } from "~/client/api-client/@tanstack/react-query.gen";
import { SnapshotDetailsPage } from "~/client/modules/repositories/routes/snapshot-details";
export const Route = createFileRoute("/(dashboard)/repositories/$repositoryId/$snapshotId/")({
component: RouteComponent,
errorComponent: (e) => <div>{e.error.message}</div>,
loader: async ({ params, context }) => {
const res = await context.queryClient.ensureQueryData({
...getRepositoryOptions({ path: { id: params.repositoryId } }),
});
return res;
},
staticData: {
breadcrumb: (match) => [
{ label: "Repositories", href: "/repositories" },
{ label: match.loaderData?.name || "Repository", href: `/repositories/${match.params.repositoryId}` },
{ label: match.params.snapshotId },
],
},
head: ({ params }) => ({
meta: [
{ title: `Zerobyte - ${params.snapshotId}` },
{
name: "description",
content: "Browse and restore files from a backup snapshot.",
},
],
}),
});
function RouteComponent() {
const { repositoryId, snapshotId } = Route.useParams();
return <SnapshotDetailsPage repositoryId={repositoryId} snapshotId={snapshotId} />;
}