'use client' import React, { useState } from 'react' import { useContext } from 'use-context-selector' import { RiInformation2Line } from '@remixicon/react' import Card from '../../card' import { extensionDallE, modelGPT4, toolNotion } from '../../card/card-mock' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' import Checkbox from '@/app/components/base/checkbox' import Badge, { BadgeState } from '@/app/components/base/badge/index' import I18n from '@/context/i18n' type InstallFromMarketplaceProps = { onClose: () => void } const InstallFromMarketplace: React.FC = ({ onClose }) => { const { locale } = useContext(I18n) // Mock a plugin list const plugins = [toolNotion, extensionDallE, modelGPT4] const [selectedPlugins, setSelectedPlugins] = useState>(new Set()) return (
Install plugin
About to install the following plugin
{plugins.length === 1 && } {plugins.length > 1 && plugins.map((plugin, index) => (
{ const newSelectedPlugins = new Set(selectedPlugins) if (newSelectedPlugins.has(index)) newSelectedPlugins.delete(index) else newSelectedPlugins.add(index) setSelectedPlugins(newSelectedPlugins) }} /> {plugin.version} : <> {`${plugin.version} -> ${plugin.latest_version}`}
Used in 3 apps
} />
))}
) } export default InstallFromMarketplace