import React, {useState} from 'react'; import {Text} from 'react-native'; import rpx, {vw} from '@/utils/rpx'; import {TabBar, TabView} from 'react-native-tab-view'; import PluginManager from '@/core/pluginManager'; import {fontWeightConst} from '@/constants/uiConst'; import SheetBody from './sheetBody'; import useColors from '@/hooks/useColors'; import NoPlugin from '@/components/base/noPlugin'; export default function Body() { const [index, setIndex] = useState(0); const colors = useColors(); const routes = PluginManager.getSortedRecommendSheetablePlugins().map( _ => ({ key: _.hash, title: _.name, }), ); const renderTabBar = (_: any) => ( ( {route.title ?? '(未命名)'} )} indicatorStyle={{ backgroundColor: colors.primary, height: rpx(4), }} /> ); if (!routes?.length) { return ; } return ( { return ; }} onIndexChange={setIndex} initialLayout={{width: vw(100)}} swipeEnabled={false} /> ); }