dify/web/app/(commonLayout)/plugins/test/card/page.tsx

75 lines
2.4 KiB
TypeScript
Raw Normal View History

2024-10-10 17:47:04 +08:00
import { handleDelete } from './actions'
2024-10-09 11:35:07 +08:00
import Card from '@/app/components/plugins/card'
2024-10-16 16:28:07 +08:00
import { customTool, extensionDallE, modelGPT4, toolNotion } from '@/app/components/plugins/card/card-mock'
2024-10-09 18:36:15 +08:00
import PluginItem from '@/app/components/plugins/plugin-item'
2024-10-10 17:47:04 +08:00
import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
2024-10-12 09:23:01 +08:00
import ProviderCard from '@/app/components/plugins/provider-card'
2024-10-11 18:18:32 +08:00
import Badge from '@/app/components/base/badge'
2024-10-16 18:05:55 +08:00
2024-10-09 11:35:07 +08:00
const PluginList = async () => {
2024-10-16 16:28:07 +08:00
const pluginList = [toolNotion, extensionDallE, modelGPT4, customTool]
2024-10-16 18:05:55 +08:00
2024-10-09 11:35:07 +08:00
return (
2024-10-09 18:12:14 +08:00
<div className='pb-3 bg-white'>
<div className='mx-3 '>
<h2 className='my-3'>Dify Plugin list</h2>
2024-10-09 18:36:15 +08:00
<div className='grid grid-cols-2 gap-3'>
2024-10-10 17:47:04 +08:00
{pluginList.map((plugin, index) => (
2024-10-11 18:05:36 +08:00
<PluginItem
key={index}
payload={plugin as any}
onDelete={handleDelete}
/>
2024-10-10 17:47:04 +08:00
))}
2024-10-09 18:12:14 +08:00
</div>
<h2 className='my-3'>Install Plugin / Package under bundle</h2>
<div className='w-[512px] rounded-2xl bg-background-section-burn p-2'>
<Card
payload={toolNotion as any}
descriptionLineRows={1}
2024-10-11 18:18:32 +08:00
titleLeft={
<Badge className='ml-1' text={toolNotion.version} />
}
2024-10-09 18:12:14 +08:00
/>
</div>
<h3 className='my-1'>Installed</h3>
<div className='w-[512px] rounded-2xl bg-background-section-burn p-2'>
<Card
payload={toolNotion as any}
descriptionLineRows={1}
installed
/>
</div>
2024-10-09 18:36:15 +08:00
2024-10-10 17:47:04 +08:00
<h3 className='my-1'>Install model provide</h3>
<div className='grid grid-cols-2 gap-3'>
{pluginList.map((plugin, index) => (
<ProviderCard key={index} payload={plugin as any} />
2024-10-10 17:47:04 +08:00
))}
</div>
2024-10-09 18:36:15 +08:00
<div className='my-3 h-[px] bg-gray-50'></div>
<h2 className='my-3'>Marketplace Plugin list</h2>
<div className='grid grid-cols-4 gap-3'>
2024-10-10 17:47:04 +08:00
{pluginList.map((plugin, index) => (
<Card
key={index}
payload={plugin as any}
footer={
2024-10-16 16:39:47 +08:00
<CardMoreInfo downloadCount={index % 2 === 0 ? 1234 : 6} tags={index % 2 === 0 ? ['Search', 'Tag that has very very long name', 'Productivity', 'Tag2'] : []} />
2024-10-10 17:47:04 +08:00
}
/>
))}
2024-10-09 18:36:15 +08:00
</div>
2024-10-09 17:50:23 +08:00
</div>
2024-10-09 18:12:14 +08:00
</div>
2024-10-09 11:35:07 +08:00
)
}
export const metadata = {
title: 'Plugins - Card',
}
export default PluginList