/* * Copyright 2025 coze-dev Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type ReactNode, useState } from 'react'; import { useBotInfoStore } from '@coze-studio/bot-detail-store/bot-info'; import { I18n } from '@coze-arch/i18n'; import { IconCozSkill, IconCozUserPermission, } from '@coze-arch/coze-design/icons'; import { MenuItem, MenuSubMenu } from '@coze-arch/coze-design'; import { NavModal, PluginPermissionManageList, PermissionManageTitle, } from '@coze-agent-ide/space-bot/component'; import { OperateTypeEnum, ToolPane } from '@coze-agent-ide/debug-tool-list'; import { SkillsNav, SkillsNavItem } from './skills-nav'; export const SkillsPane: React.FC = () => { const [showModal, setShowModal] = useState(false); const [navItem, setNavItem] = useState(SkillsNavItem.Permission); const botId = useBotInfoStore(store => store.botId); const getMainContent = () => { if (!showModal) { return null; } switch (navItem) { case SkillsNavItem.Permission: return ( ); default: return null; } }; const getMainContentTitle = () => { if (!showModal) { return null; } switch (navItem) { case SkillsNavItem.Permission: return ; default: return null; } }; const { menusNode } = getMenus(nav => { setNavItem(nav); setShowModal(true); }); return ( <> setShowModal(false)} title={I18n.t('debug_skills')} navigation={} mainContent={getMainContent()} mainContentTitle={getMainContentTitle()} width={1000} bodyStyle={{ padding: 0, }} /> { setNavItem(SkillsNavItem.Permission); setShowModal(true); }} dropdownProps={{ render: {menusNode}, showTick: true, clickToHide: true, zIndex: 1000, }} icon={} /> ); }; const getMenus = (onSwitchNavItem: (navItem: SkillsNavItem) => void) => { const menus: { icon: ReactNode; title: string; navItem: SkillsNavItem }[] = [ { icon: , title: I18n.t('permission_manage_modal_tab_name'), navItem: SkillsNavItem.Permission, }, ]; return { menusCount: menus.length, menusNode: ( <> {menus.map(menu => ( onSwitchNavItem(menu.navItem)} > {menu.title} ))} ), }; };