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
Snapshot: {snapshotId}
{data.snapshot.id}
{data.snapshot.short_id}
{data.snapshot.hostname}
{new Date(data.snapshot.time).toLocaleString()}
{path}
))}