mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 23:05:56 -05:00
5c6b8ec015
GitOrigin-RevId: 7747881b99d23ebb0ee38d044c671bffb7504302
14 lines
588 B
TypeScript
14 lines
588 B
TypeScript
import { useOutlineContext } from '@/features/ide-react/context/outline-context'
|
|
import useCollapsiblePanel from '@/features/ide-react/hooks/use-collapsible-panel'
|
|
import { useRef } from 'react'
|
|
import { ImperativePanelHandle } from 'react-resizable-panels'
|
|
|
|
export const useOutlinePane = () => {
|
|
const { canShowOutline, outlineExpanded } = useOutlineContext()
|
|
const outlinePanelRef = useRef<ImperativePanelHandle>(null)
|
|
const outlineEnabled = canShowOutline && outlineExpanded
|
|
|
|
useCollapsiblePanel(outlineEnabled, outlinePanelRef)
|
|
|
|
return { outlineEnabled, outlinePanelRef }
|
|
}
|