2020-06-29 09:05:08 -04:00
|
|
|
|
import React from 'react'
|
|
|
|
|
import PropTypes from 'prop-types'
|
2020-09-01 04:09:04 -04:00
|
|
|
|
import OutlineList from './outline-list'
|
2020-06-29 09:05:08 -04:00
|
|
|
|
|
2020-07-28 05:37:46 -04:00
|
|
|
|
function OutlineRoot({ outline, jumpToLine, highlightedLine }) {
|
2020-06-29 09:05:08 -04:00
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{outline.length ? (
|
2020-07-28 05:37:46 -04:00
|
|
|
|
<OutlineList
|
|
|
|
|
outline={outline}
|
|
|
|
|
jumpToLine={jumpToLine}
|
|
|
|
|
isRoot
|
|
|
|
|
highlightedLine={highlightedLine}
|
|
|
|
|
/>
|
2020-06-29 09:05:08 -04:00
|
|
|
|
) : (
|
|
|
|
|
<div className="outline-body-no-elements">
|
|
|
|
|
We can’t find any sections or subsections in this file.{' '}
|
|
|
|
|
<a
|
|
|
|
|
href="/learn/how-to/Using_the_File_Outline_feature"
|
|
|
|
|
className="outline-body-link"
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
>
|
2020-08-18 09:08:49 -04:00
|
|
|
|
Find out more about the file outline
|
2020-06-29 09:05:08 -04:00
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutlineRoot.propTypes = {
|
|
|
|
|
outline: PropTypes.array.isRequired,
|
2020-07-28 05:37:46 -04:00
|
|
|
|
jumpToLine: PropTypes.func.isRequired,
|
|
|
|
|
highlightedLine: PropTypes.number
|
2020-06-29 09:05:08 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default OutlineRoot
|