overleaf/services/web/frontend/js/ide/outline/components/OutlineRoot.js
Timothée Alby 1012dbc3c4 Merge pull request #2961 from overleaf/ta-spike-outline
Document Outline Spike

GitOrigin-RevId: adc315a3546147eb10c7a40ae70f9cab1cbf7b8d
2020-06-30 02:10:19 +00:00

32 lines
840 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react'
import PropTypes from 'prop-types'
import OutlineList from './OutlineList'
function OutlineRoot({ outline, jumpToLine }) {
return (
<div>
{outline.length ? (
<OutlineList outline={outline} jumpToLine={jumpToLine} isRoot />
) : (
<div className="outline-body-no-elements">
We cant 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"
>
Know more about the file outline
</a>
</div>
)}
</div>
)
}
OutlineRoot.propTypes = {
outline: PropTypes.array.isRequired,
jumpToLine: PropTypes.func.isRequired
}
export default OutlineRoot