You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/kubernetes/volumes/ListView/VolumesView.tsx

41 lines
1.0 KiB

import { useCurrentStateAndParams } from '@uirouter/react';
import { Database, HardDrive } from 'lucide-react';
import { PageHeader } from '@@/PageHeader';
import { WidgetTabs, Tab, findSelectedTabIndex } from '@@/Widget/WidgetTabs';
import { VolumesDatatable } from './VolumesDatatable';
import { StorageDatatable } from './StorageDatatable';
export function VolumesView() {
const tabs: Tab[] = [
{
name: 'Volumes',
icon: Database,
widget: <VolumesDatatable />,
selectedTabParam: 'volumes',
},
{
name: 'Storage',
icon: HardDrive,
widget: <StorageDatatable />,
selectedTabParam: 'storage',
},
];
const currentTabIndex = findSelectedTabIndex(
useCurrentStateAndParams(),
tabs
);
return (
<>
<PageHeader title="Volume list" breadcrumbs="Volumes" reload />
<>
<WidgetTabs tabs={tabs} currentTabIndex={currentTabIndex} />
<div className="content">{tabs[currentTabIndex].widget}</div>
</>
</>
);
}