import { useSuspenseQuery } from "@tanstack/react-query"; import { Suspense } from "react"; import { getRepositoryOptions } from "~/client/api-client/@tanstack/react-query.gen"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/client/components/ui/tabs"; import { RepositoryInfoTabContent } from "../tabs/info"; import { RepositorySnapshotsTabContent } from "../tabs/snapshots"; import { useNavigate, useSearch } from "@tanstack/react-router"; import type { BackupSchedule, Snapshot } from "~/client/lib/types"; import type { GetRepositoryStatsResponse } from "~/client/api-client/types.gen"; export default function RepositoryDetailsPage({ repositoryId, initialSnapshots, initialBackupSchedules, initialStats, }: { repositoryId: string; initialSnapshots?: Snapshot[]; initialBackupSchedules?: BackupSchedule[]; initialStats?: GetRepositoryStatsResponse; }) { const navigate = useNavigate(); const { tab } = useSearch({ from: "/(dashboard)/repositories/$repositoryId/" }); const activeTab = tab || "info"; const { data } = useSuspenseQuery({ ...getRepositoryOptions({ path: { shortId: repositoryId } }), }); return ( <> navigate({ to: ".", search: (s) => ({ ...s, tab: value }) })}> Configuration Snapshots ); }