@@ -38,6 +38,7 @@ import {
3838import { InstallDialog } from './InstallDialog'
3939import { InstalledTab } from './InstalledTab'
4040import { MarketplaceTab } from './MarketplaceTab'
41+ import { UpdatesTab } from './UpdatesTab'
4142import type { GitStatus , MaimaiVersion , MarketplaceSortKey , PluginInfo , PluginLoadProgress } from './types'
4243
4344// 主导出组件:包装 RestartProvider
@@ -712,25 +713,6 @@ function PluginsPageContent() {
712713 } ) . length
713714 }
714715
715- // 过滤插件用于可更新标签页
716- const filteredUpdatablePlugins = plugins . filter ( plugin => {
717- if ( ! plugin . manifest ) return false
718-
719- const matchesSearch = searchQuery === '' ||
720- plugin . manifest . name ?. toLowerCase ( ) . includes ( searchQuery . toLowerCase ( ) ) ||
721- plugin . manifest . description ?. toLowerCase ( ) . includes ( searchQuery . toLowerCase ( ) ) ||
722- ( plugin . manifest . keywords && plugin . manifest . keywords . some ( k => k . toLowerCase ( ) . includes ( searchQuery . toLowerCase ( ) ) ) )
723-
724- const matchesCategory = categoryFilter === 'all' ||
725- ( plugin . manifest . categories && plugin . manifest . categories . includes ( categoryFilter ) )
726-
727- const matchesCompatibility = ! showCompatibleOnly ||
728- ! maimaiVersion ||
729- checkPluginCompatibility ( plugin )
730-
731- return plugin . installed && needsUpdate ( plugin ) && matchesSearch && matchesCategory && matchesCompatibility
732- } )
733-
734716 return (
735717 < ScrollArea className = "h-full" >
736718 < div className = "space-y-6 p-4 sm:p-6" >
@@ -969,15 +951,25 @@ function PluginsPageContent() {
969951 getStatusBadge = { getStatusBadge }
970952 getIncompatibleReason = { getIncompatibleReason }
971953 />
972- ) : (
973- < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
974- { filteredUpdatablePlugins . map ( ( plugin ) => (
975- < div key = { plugin . id } >
976- { /* PluginCard would go here */ }
977- </ div >
978- ) ) }
979- </ div >
980- ) }
954+ ) : activeTab === 'updates' ? (
955+ < UpdatesTab
956+ plugins = { plugins }
957+ searchQuery = { searchQuery }
958+ categoryFilter = { categoryFilter }
959+ showCompatibleOnly = { showCompatibleOnly }
960+ gitStatus = { gitStatus }
961+ maimaiVersion = { maimaiVersion }
962+ pluginStats = { pluginStats }
963+ loadProgress = { loadProgress }
964+ onInstall = { openInstallDialog }
965+ onUpdate = { handleUpdate }
966+ onUninstall = { handleUninstall }
967+ checkPluginCompatibility = { checkPluginCompatibility }
968+ needsUpdate = { needsUpdate }
969+ getStatusBadge = { getStatusBadge }
970+ getIncompatibleReason = { getIncompatibleReason }
971+ />
972+ ) : null }
981973
982974 { /* 安装对话框 */ }
983975 < InstallDialog
0 commit comments