import React, { useState, useEffect } from 'react' import PropTypes from 'prop-types' import { OverlayTrigger, Tooltip } from 'react-bootstrap' import classNames from 'classnames' import OutlineRoot from './OutlineRoot' function OutlinePane({ isTexFile, outline, jumpToLine }) { const [expanded, setExpanded] = useState(true) useEffect(() => setExpanded(isTexFile), [isTexFile]) const expandCollapseIconClasses = classNames('fa', 'outline-caret-icon', { 'fa-angle-down': expanded, 'fa-angle-right': !expanded }) const headerClasses = classNames('outline-pane', { 'outline-pane-disabled': !isTexFile }) function handleExpandCollapseClick() { if (isTexFile) { setExpanded(!expanded) } } return (
The File outline is a beta feature. Click here to manage your beta program membership.
{expanded && isTexFile ? (
) : null}
) } const tooltip = ( The File outline is a beta feature. ) OutlinePane.propTypes = { isTexFile: PropTypes.bool.isRequired, outline: PropTypes.array.isRequired, jumpToLine: PropTypes.func.isRequired } export default OutlinePane