import useSWR from 'swr' import { LockClosedIcon } from '@heroicons/react/24/solid' import { useTranslation } from 'react-i18next' import Link from 'next/link' import SerpapiPlugin from './SerpapiPlugin' import { fetchPluginProviders } from '@/service/common' import type { PluginProvider } from '@/models/common' const PluginPage = () => { const { t } = useTranslation() const { data: plugins, mutate } = useSWR('/workspaces/current/tool-providers', fetchPluginProviders) const Plugin_MAP: Record JSX.Element> = { serpapi: (plugin: PluginProvider) => mutate()} />, } return (
{plugins?.map(plugin => Plugin_MAP[plugin.tool_name](plugin))}
{t('common.provider.encrypted.front')} PKCS1_OAEP {t('common.provider.encrypted.back')}
) } export default PluginPage