import React, { useCallback } from 'react'; import { Button } from 'components/button'; import { ScrollView, ScrollViewType } from 'components/layout'; import { useResponsiveLayout } from 'hooks'; import { ButtonColorVariant, ButtonType } from 'components'; export const Tabs: React.FC = ({ activeTab, variant = 'default', tabs, setActiveTab, tabProps, activeTabProps, ...props }) => { const { isMobile } = useResponsiveLayout(); const my = isMobile ? undefined : 'xs'; const inActiveVariant = variant === 'default' ? 'text' : 'underline-inactive'; const activeVariant = variant === 'default' ? 'base' : 'underline'; const shapeVariant = variant === 'default' ? 'round' : 'square'; const getColorVariant = useCallback( (index) => { return (index === activeTab ? activeVariant : inActiveVariant) as ButtonColorVariant; }, [activeTab, activeVariant, inActiveVariant] ); const getTitleColor = useCallback( (index) => { return index === activeTab ? 'title' : 'body'; }, [activeTab] ); const activeTabStyle = useCallback( (tabIndex) => { return tabIndex === activeTab ? activeTabProps : {}; }, [activeTab, activeTabProps] ); return ( {tabs.map((tab) => (