import React, { useState } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import OutlineList from './OutlineList' function OutlineItem({ outlineItem, jumpToLine }) { const [expanded, setExpanded] = useState(true) const mainItemClasses = classNames('outline-item', { 'outline-item-no-children': !outlineItem.children }) const expandCollapseIconClasses = classNames('fa', 'outline-caret-icon', { 'fa-angle-down': expanded, 'fa-angle-right': !expanded }) function handleExpandCollapseClick() { setExpanded(!expanded) } function handleOutlineItemLinkClick() { jumpToLine(outlineItem.line) } return (