import React, { useEffect } from 'react' import classNames from 'classnames' import { useTranslation } from 'react-i18next' import OutlineRoot from './outline-root' import Icon from '../../../shared/components/icon' import withErrorBoundary from '../../../infrastructure/error-boundary' import Tooltip from '../../../shared/components/tooltip' const OutlinePane = React.memo<{ isTexFile: boolean outline: any[] jumpToLine(line: number): void onToggle(value: boolean): void eventTracking: any highlightedLine?: number show: boolean isPartial?: boolean expanded?: boolean toggleExpanded: () => void }>(function OutlinePane({ isTexFile, outline, jumpToLine, onToggle, highlightedLine, isPartial = false, expanded, toggleExpanded, }) { const { t } = useTranslation() const isOpen = Boolean(isTexFile && expanded) useEffect(() => { onToggle(isOpen) }, [isOpen, onToggle]) const headerClasses = classNames('outline-pane', { 'outline-pane-disabled': !isTexFile, }) return (
{isOpen && (
)}
) }) export default withErrorBoundary(OutlinePane)