import React, {createContext, useContext, useState, useRef} from "react" import {TabsPrimary, TabsPrimaryProps} from "./TabsPrimary" import {TabsSecondary, TabsSecondaryProps} from "./TabsSecondary"; import {TabsAnalytics} from "./TabsAnalytics"; export interface TabsPropsCommon { /** The kind of tabs to render. If not provided, the component will render the primary tabs. */ kind?: 'secondary' | null } // // TODO: in the future unify the TabsPrimary and TabsSecondary components? type TabsProps = T & TabsPropsCommon const TabsContext = createContext<{ kind: string | null }>({ kind: null, }) /** * A component that renders a tabs component. * * @category Component */ export function Tabs(props: TabsProps) { let tabs: React.ReactNode if (props.kind === 'secondary') { tabs = } else { tabs = } return {tabs} } Tabs.Item = function TabsItem(props: any) { const {kind} = useContext(TabsContext) if (kind === 'secondary') { return } return } //@ts-ignore TODO: fix ts Tabs.Item.displayName = "Tabs.Item" Tabs.Content = function TabsContent(props: any) { const {kind} = useContext(TabsContext) if (kind === 'secondary') { return } return } //@ts-ignore TODO: fix ts Tabs.Content.displayName = "Tabs.Content"