OutlineRoot.js 840 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react'
  2. import PropTypes from 'prop-types'
  3. import OutlineList from './OutlineList'
  4. function OutlineRoot({ outline, jumpToLine }) {
  5. return (
  6. <div>
  7. {outline.length ? (
  8. <OutlineList outline={outline} jumpToLine={jumpToLine} isRoot />
  9. ) : (
  10. <div className="outline-body-no-elements">
  11. We can’t find any sections or subsections in this file.{' '}
  12. <a
  13. href="/learn/how-to/Using_the_File_Outline_feature"
  14. className="outline-body-link"
  15. target="_blank"
  16. rel="noopener noreferrer"
  17. >
  18. Know more about the file outline
  19. </a>
  20. </div>
  21. )}
  22. </div>
  23. )
  24. }
  25. OutlineRoot.propTypes = {
  26. outline: PropTypes.array.isRequired,
  27. jumpToLine: PropTypes.func.isRequired
  28. }
  29. export default OutlineRoot