| |
| |
| |
|
|
| import { PluginListItem } from '@typings/plugin'; |
| import { PluginCard } from './PluginCard'; |
| import { StatePanel } from '@components/console'; |
|
|
| interface PluginListProps { |
| plugins: PluginListItem[]; |
| onEnable: (name: string) => void; |
| onDisable: (name: string) => void; |
| } |
|
|
| export function PluginList({ plugins, onEnable, onDisable }: PluginListProps) { |
| if (plugins.length === 0) { |
| return ( |
| <StatePanel |
| state="empty" |
| title="暂无已部署的插件" |
| description="插件随部署注入,请检查部署配置" |
| /> |
| ); |
| } |
|
|
| return ( |
| <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"> |
| {plugins.map((plugin) => ( |
| <PluginCard |
| key={plugin.metadata.name} |
| plugin={plugin} |
| onEnable={onEnable} |
| onDisable={onDisable} |
| /> |
| ))} |
| </div> |
| ); |
| } |
|
|