From e561942cf7f6147d9217e197c671277433d3d785 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Wed, 3 Jan 2024 00:12:16 +0100 Subject: [PATCH] Use new TabWidget for VM route --- virtweb_frontend/src/widgets/TabsWidget.tsx | 4 +-- .../src/widgets/net/NetworkDetails.tsx | 2 +- .../src/widgets/vms/VMDetails.tsx | 30 ++++++++++--------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/virtweb_frontend/src/widgets/TabsWidget.tsx b/virtweb_frontend/src/widgets/TabsWidget.tsx index 6ef0563..5411eaa 100644 --- a/virtweb_frontend/src/widgets/TabsWidget.tsx +++ b/virtweb_frontend/src/widgets/TabsWidget.tsx @@ -10,14 +10,14 @@ export interface TabWidgetOption { export function TabsWidget(p: { currTab: E; options: TabWidgetOption[]; - onValueChange: (v: E) => void; + onTabChange: (v: E) => void; }): React.ReactElement { const activeOptions = p.options.filter((v) => v.visible); const currTabIndex = activeOptions.findIndex((v) => v.value === p.currTab); const updateActiveTab = (index: number) => { - p.onValueChange(activeOptions[index].value); + p.onTabChange(activeOptions[index].value); }; return ( diff --git a/virtweb_frontend/src/widgets/net/NetworkDetails.tsx b/virtweb_frontend/src/widgets/net/NetworkDetails.tsx index b7ede54..2476164 100644 --- a/virtweb_frontend/src/widgets/net/NetworkDetails.tsx +++ b/virtweb_frontend/src/widgets/net/NetworkDetails.tsx @@ -55,7 +55,7 @@ function NetworkDetailsInner(p: DetailsInnerProps): React.ReactElement { <> - - setCurrTab(newVal)}> - - - - {!p.editable && ( - - )} - - + {currTab === VMTab.General && } {currTab === VMTab.Storage && }