import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons'; import React from 'react'; import { Tabs, TabPane, Tag } from '@/components/ui'; import { Button } from 'antd'; import { CHANNEL_OPTIONS } from '../../../constants'; import { getChannelIcon, isRoot } from '../../../helpers'; import './channels-tabs.css'; const ChannelsTabs = ({ enableTagMode, activeTypeKey, setActiveTypeKey, channelTypeCounts, availableTypeKeys, loadChannels, activePage, pageSize, idSort, setActivePage, setEditingChannel, setShowEdit, t, }) => { const createButton = isRoot() ? ( ) : null; if (enableTagMode) { return createButton ? (
{createButton}
) : null; } const handleTabChange = (key) => { setActiveTypeKey(key); setActivePage(1); loadChannels(1, pageSize, idSort, enableTagMode, key); }; return ( {t('全部')} {channelTypeCounts['all'] || 0} } /> {CHANNEL_OPTIONS.filter((opt) => availableTypeKeys.includes(String(opt.value)), ).map((option) => { const key = String(option.value); const count = channelTypeCounts[option.value] || 0; return ( {getChannelIcon(option.value)} {option.label} {count} } /> ); })} ); }; export default ChannelsTabs;