diff --git a/web/src/components/playground/DebugPanel.js b/web/src/components/playground/DebugPanel.js index 935bd681..8487d555 100644 --- a/web/src/components/playground/DebugPanel.js +++ b/web/src/components/playground/DebugPanel.js @@ -1,17 +1,19 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { Card, Typography, Tabs, TabPane, Button, + Dropdown, } from '@douyinfe/semi-ui'; import { Code, - FileText, Zap, Clock, X, + Eye, + Send, } from 'lucide-react'; import { useTranslation } from 'react-i18next'; @@ -24,6 +26,61 @@ const DebugPanel = ({ }) => { const { t } = useTranslation(); + const [activeKey, setActiveKey] = useState(activeDebugTab); + + useEffect(() => { + setActiveKey(activeDebugTab); + }, [activeDebugTab]); + + const handleTabChange = (key) => { + setActiveKey(key); + onActiveDebugTabChange(key); + }; + + const renderArrow = (items, pos, handleArrowClick, defaultNode) => { + const style = { + width: 32, + height: 32, + margin: '0 12px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + borderRadius: '100%', + background: 'rgba(var(--semi-grey-1), 1)', + color: 'var(--semi-color-text)', + cursor: 'pointer', + }; + + return ( + + {items.map(item => { + return ( + handleTabChange(item.itemKey)} + > + {item.tab} + + ); + })} + + } + > + {pos === 'start' ? ( +
+ ← +
+ ) : ( +
+ → +
+ )} +
+ ); + }; + return ( - {/* 移动端关闭按钮 */} {styleState.isMobile && onCloseDebugPanel && (