'use client' import React from 'react' import type { FC } from 'react' import DetailHeader from './detail-header' import EndpointList from './endpoint-list' import ActionList from './action-list' import ModelList from './model-list' import Drawer from '@/app/components/base/drawer' import { usePluginPageContext } from '@/app/components/plugins/plugin-page/context' import cn from '@/utils/classnames' type Props = { onDelete: () => void } const PluginDetailPanel: FC = ({ onDelete, }) => { const pluginDetail = usePluginPageContext(v => v.currentPluginDetail) const setCurrentPluginDetail = usePluginPageContext(v => v.setCurrentPluginDetail) const handleHide = () => setCurrentPluginDetail(undefined) if (!pluginDetail) return null return ( {pluginDetail && ( <>
{!!pluginDetail.declaration.endpoint && } {!!pluginDetail.declaration.tool && } {!!pluginDetail.declaration.model && }
)}
) } export default PluginDetailPanel