diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index beec29bf0..430d5edd9 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -13,4 +13,5 @@ export * from "./main_content_div"; export * from "./title"; export * from "./search_form_left"; export * from "./search_form_right"; -export * from "./table_div"; \ No newline at end of file +export * from "./table_div"; +export * from "./tab"; \ No newline at end of file diff --git a/packages/common/business_components/src/ui/tab/index.tsx b/packages/common/business_components/src/ui/tab/index.tsx new file mode 100644 index 000000000..9d24562f8 --- /dev/null +++ b/packages/common/business_components/src/ui/tab/index.tsx @@ -0,0 +1,36 @@ +import { Tabs, TabsList, TabsTrigger } from '@common/components/ui'; +import React from 'react'; + +interface TabItem { + value: string; + label: string; +} + +interface UITabProps extends React.HTMLAttributes { + defaultValue?: string; + tabList: TabItem[]; + children: React.ReactNode; +} + +const UITab = React.forwardRef< + HTMLDivElement, + UITabProps +>(({defaultValue, tabList, children}, ref)=>{ + return ( + + + {tabList.map((tab) => ( + + {tab.label} + + ))} + + {children} + + ) +}) +export { UITab };