mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 11:03:36 -05:00
9daa8f5d98
[web] rename all the JSX files to .jsx/.tsx GitOrigin-RevId: 82056ae47e017523722cf258dcc83c8a925a28f7
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import PropTypes from 'prop-types'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import OutlineList from './outline-list'
|
|
|
|
function OutlineRoot({ outline, jumpToLine, highlightedLine }) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<div>
|
|
{outline.length ? (
|
|
<OutlineList
|
|
outline={outline}
|
|
jumpToLine={jumpToLine}
|
|
isRoot
|
|
highlightedLine={highlightedLine}
|
|
containsHighlightedLine
|
|
/>
|
|
) : (
|
|
<div className="outline-body-no-elements">
|
|
{t('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"
|
|
>
|
|
{t('find_out_more_about_the_file_outline')}
|
|
</a>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
OutlineRoot.propTypes = {
|
|
outline: PropTypes.array.isRequired,
|
|
jumpToLine: PropTypes.func.isRequired,
|
|
highlightedLine: PropTypes.number,
|
|
}
|
|
|
|
export default OutlineRoot
|