import React, {useCallback, useState} from 'react';
import {Text} from 'react-native';
import rpx from '@/utils/rpx';
import PluginManager from '@/core/pluginManager';
import {TabBar, TabView} from 'react-native-tab-view';
import {fontWeightConst} from '@/constants/uiConst';
import BoardPanelWrapper from './boardPanelWrapper';
import useColors from '@/hooks/useColors';
import Empty from '@/components/base/empty';
export default function TopListBody() {
const routes = PluginManager.getSortedTopListsablePlugins().map(_ => ({
key: _.hash,
title: _.name,
}));
const [index, setIndex] = useState(0);
const colors = useColors();
const renderScene = useCallback(
(props: {route: {key: string}}) => (
),
[],
);
if (!routes?.length) {
return ;
}
return (
(
(
{route.title}
)}
indicatorStyle={{
backgroundColor: colors.primary,
height: rpx(4),
}}
/>
)}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{width: rpx(750)}}
/>
);
}