diff --git a/services/web/frontend/js/features/ide-redesign/components/rail/rail-panel-header.tsx b/services/web/frontend/js/features/ide-redesign/components/rail/rail-panel-header.tsx index 8685d9419d..3099245ee1 100644 --- a/services/web/frontend/js/features/ide-redesign/components/rail/rail-panel-header.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/rail/rail-panel-header.tsx @@ -1,18 +1,28 @@ import { useTranslation } from 'react-i18next' import { useRailContext } from '../../contexts/rail-context' import OLIconButton from '@/shared/components/ol/ol-icon-button' -import React from 'react' +import React, { useCallback } from 'react' import OLTooltip from '@/shared/components/ol/ol-tooltip' export default function RailPanelHeader({ title, actions, + onClose, }: { title: React.ReactNode actions?: React.ReactNode[] + onClose?: () => void }) { const { t } = useTranslation() const { handlePaneCollapse } = useRailContext() + + const handleClose = useCallback(() => { + handlePaneCollapse() + if (onClose) { + onClose() + } + }, [handlePaneCollapse, onClose]) + return (