export type CustomWorldWorkFilter = 'all' | 'draft' | 'published'; const FILTER_OPTIONS: Array<{ id: CustomWorldWorkFilter; label: string; }> = [ { id: 'all', label: '全部' }, { id: 'draft', label: '草稿' }, { id: 'published', label: '已发布' }, ]; type CustomWorldWorkTabsProps = { activeFilter: CustomWorldWorkFilter; draftCount: number; publishedCount: number; onChange: (filter: CustomWorldWorkFilter) => void; }; export function CustomWorldWorkTabs({ activeFilter, draftCount, publishedCount, onChange, }: CustomWorldWorkTabsProps) { return (
{FILTER_OPTIONS.map((option) => { const count = option.id === 'draft' ? draftCount : option.id === 'published' ? publishedCount : draftCount + publishedCount; return ( ); })}
); }