Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled
* fix: multiple mobile and responsiveness issues fix(mobile): scroll reset on snapshot selection fix(mobile): layout improvements refactor(volume-details): improve layout refactor: better card breakpoints layouts in backps list fix(ui): keep sidebar in the state it was before reloading refactor(ui): keep the same grid size in all breakpoints refactor: manual hotkey devpanel to tanstack hotkeys * chore: pr feedback
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
import { useSearch } from "@tanstack/react-router";
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/client/components/ui/tabs";
|
|
import { VolumeInfoTabContent } from "../tabs/info";
|
|
import { FilesTabContent } from "../tabs/files";
|
|
import { getVolumeOptions } from "~/client/api-client/@tanstack/react-query.gen";
|
|
import { useNavigate } from "@tanstack/react-router";
|
|
|
|
export function VolumeDetails({ volumeId }: { volumeId: string }) {
|
|
const navigate = useNavigate();
|
|
const searchParams = useSearch({ from: "/(dashboard)/volumes/$volumeId" });
|
|
|
|
const activeTab = searchParams.tab || "info";
|
|
|
|
const { data } = useSuspenseQuery({
|
|
...getVolumeOptions({ path: { id: volumeId } }),
|
|
});
|
|
|
|
const { volume, statfs } = data;
|
|
|
|
return (
|
|
<>
|
|
<Tabs value={activeTab} onValueChange={(value) => navigate({ to: ".", search: () => ({ tab: value }) })}>
|
|
<TabsList className="mb-2">
|
|
<TabsTrigger value="info">Configuration</TabsTrigger>
|
|
<TabsTrigger value="files">Files</TabsTrigger>
|
|
</TabsList>
|
|
<TabsContent value="info">
|
|
<VolumeInfoTabContent volume={volume} statfs={statfs} />
|
|
</TabsContent>
|
|
<TabsContent value="files">
|
|
<FilesTabContent volume={volume} />
|
|
</TabsContent>
|
|
</Tabs>
|
|
</>
|
|
);
|
|
}
|