import { useQuery } from "@tanstack/react-query"; import { useParams } from "react-router"; import { listSnapshotFilesOptions } from "~/api-client/@tanstack/react-query.gen"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"; import { RestoreSnapshotDialog } from "../components/restore-snapshot-dialog"; import { SnapshotFilesList } from "../components/snapshot-files"; export default function SnapshotDetailsPage() { const { name, snapshotId } = useParams<{ name: string; snapshotId: string }>(); const { data } = useQuery({ ...listSnapshotFilesOptions({ path: { name: name ?? "", snapshotId: snapshotId ?? "" }, query: { path: "/" }, }), enabled: !!name && !!snapshotId, }); if (!name || !snapshotId) { return (

Invalid snapshot reference

); } return (

{name}

Snapshot: {snapshotId}

File Explorer Browse the files and folders in this snapshot. {data?.snapshot && ( Snapshot Information
Snapshot ID:

{data.snapshot.id}

Short ID:

{data.snapshot.short_id}

Hostname:

{data.snapshot.hostname}

Time:

{new Date(data.snapshot.time).toLocaleString()}

Paths:
{data.snapshot.paths.map((path) => (

{path}

))}
)}
); }