mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Update workbench events (#30254)
GitOrigin-RevId: 7434483ce125676f1d7d76dfcb09d6691f9dadef
This commit is contained in:
+12
-2
@@ -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 (
|
||||
<div className="rail-panel-header">
|
||||
<h4 className="rail-panel-title">{title}</h4>
|
||||
@@ -25,7 +35,7 @@ export default function RailPanelHeader({
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
>
|
||||
<OLIconButton
|
||||
onClick={handlePaneCollapse}
|
||||
onClick={handleClose}
|
||||
className="rail-panel-header-button-subdued"
|
||||
icon="close"
|
||||
accessibilityLabel={t('close')}
|
||||
|
||||
Reference in New Issue
Block a user