import type { FC, ReactNode } from 'react'; import React from 'react'; import { CodeOutlined, SkinOutlined } from '@ant-design/icons'; import { useRouteMeta } from 'dumi'; import type { IContentTabsProps } from 'dumi/theme-default/slots/ContentTabs'; import type { TabsProps } from 'rc-tabs'; import { Tabs } from 'antd'; const titleMap: Record = { design: '设计', }; const iconMap: Record = { design: , }; const ContentTabs: FC = ({ tabs, tabKey, onChange }) => { const meta = useRouteMeta(); if (!meta.tabs) { return null; } const items: TabsProps['items'] = [ { label: ( 开发 ), key: 'development', }, ]; tabs?.forEach((tab) => { items.push({ label: ( {iconMap[tab.key]} {titleMap[tab.key]} ), key: tab.key, }); }); return ( onChange(tabs.find((tab) => tab.key === key))} style={{ margin: '32px 0 -16px' }} /> ); }; export default ContentTabs;