Use new TabWidget for VM route
This commit is contained in:
virtweb_frontend/src/widgets
@ -10,14 +10,14 @@ export interface TabWidgetOption<E> {
|
||||
export function TabsWidget<E>(p: {
|
||||
currTab: E;
|
||||
options: TabWidgetOption<E>[];
|
||||
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 (
|
||||
|
Reference in New Issue
Block a user