apps/web: use items for Tabs component
This commit is contained in:
parent
7f5707aa99
commit
2d8e9f2db0
@ -45,19 +45,21 @@ const ComponentWrapper = styled.div`
|
||||
`;
|
||||
|
||||
function Form({ prune }) {
|
||||
const items = formTabs
|
||||
.filter((tab) => !prune?.includes(tab.id))
|
||||
.map(({ id, title, Component }) => ({
|
||||
key: id,
|
||||
label: title,
|
||||
children: (
|
||||
<ComponentWrapper>
|
||||
<Component />
|
||||
</ComponentWrapper>
|
||||
),
|
||||
}));
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<Tabs type="card" tabBarGutter="5px">
|
||||
{formTabs
|
||||
.filter((tab) => !prune?.includes(tab.id))
|
||||
.map(({ id, title, Component }) => (
|
||||
<Tabs.TabPane tab={title} key={id}>
|
||||
<ComponentWrapper>
|
||||
<Component />
|
||||
</ComponentWrapper>
|
||||
</Tabs.TabPane>
|
||||
))}
|
||||
</Tabs>
|
||||
<Tabs type="card" tabBarGutter="5px" items={items} />
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user