11import { CustomTooltip } from '@remix-ui/helper'
2- import React , { useEffect , useState } from 'react' // eslint-disable-line
2+ import React from 'react' // eslint-disable-line
33import { FormattedMessage } from 'react-intl'
44import { RemixUiTerminalProps } from '../types/terminalTypes'
55export const RemixUITerminalMenuToggle = ( props : RemixUiTerminalProps ) => {
66
7- const [ isPanelHidden , setIsPanelHidden ] = useState ( false )
8-
9- useEffect ( ( ) => {
10- // Initialize panel hidden state
11- const initPanelState = async ( ) => {
12- const hidden = await props . plugin . call ( 'terminal' , 'isPanelHidden' )
13- setIsPanelHidden ( hidden )
14- }
15- initPanelState ( )
16-
17- // Listen for panel visibility changes
18- const handlePanelShown = ( ) => setIsPanelHidden ( false )
19- const handlePanelHidden = ( ) => setIsPanelHidden ( true )
20-
21- props . plugin . on ( 'terminal' , 'terminalPanelShown' , handlePanelShown )
22- props . plugin . on ( 'terminal' , 'terminalPanelHidden' , handlePanelHidden )
23-
24- return ( ) => {
25- props . plugin . off ( 'terminal' , 'terminalPanelShown' )
26- props . plugin . off ( 'terminal' , 'terminalPanelHidden' )
27- }
28- } , [ ] )
29-
307 async function handleToggleTerminal ( ) : Promise < void > {
318 // Toggle the bottom terminal panel using terminal-wrap component
329 await props . plugin . call ( 'terminal' , 'togglePanel' )
@@ -42,7 +19,7 @@ export const RemixUITerminalMenuToggle = (props: RemixUiTerminalProps) => {
4219 >
4320 < i
4421 className = { `mx-2 codicon codicon-close fw-bold fs-5` }
45- data-id = "terminalToggleIcon "
22+ data-id = "hideBottomPanel "
4623 onClick = { handleToggleTerminal }
4724 > </ i >
4825 </ CustomTooltip >
0 commit comments