feat: plugin uninstall & plugin list filtering

This commit is contained in:
twwu
2024-10-31 16:20:25 +08:00
parent 4adb61d6c7
commit 36ab121b87
9 changed files with 186 additions and 66 deletions

View File

@ -1,22 +1,21 @@
import type { FC } from 'react'
import PluginItem from '../../plugin-item'
import { customTool, extensionDallE, modelGPT4, toolNotion } from '@/app/components/plugins/card/card-mock'
import type { InstalledPlugin } from '../../types'
const PluginList = () => {
const pluginList = [toolNotion, extensionDallE, modelGPT4, customTool]
type IPluginListProps = {
pluginList: InstalledPlugin[]
}
const PluginList: FC<IPluginListProps> = ({ pluginList }) => {
return (
<div className='pb-3 bg-white'>
<div>
<div className='grid grid-cols-2 gap-3'>
{pluginList.map((plugin, index) => (
<PluginItem
key={index}
payload={plugin as any}
onDelete={() => {}}
source={'debug'}
/>
))}
</div>
<div className='grid grid-cols-2 gap-3'>
{pluginList.map(plugin => (
<PluginItem
key={plugin.plugin_id}
plugin={plugin}
/>
))}
</div>
</div>
)