Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
 
 
 
 

36 line
722 B

  1. import * as React from 'react'
  2. import Head from 'next/head'
  3. import unified from 'unified'
  4. import parse from 'remark-parse'
  5. import remark2react from 'remark-react'
  6. import docgen from '../../docgen.json'
  7. const Header = ({ of: ofAttr }) => {
  8. const docs = docgen.find(d => d.displayName === ofAttr)
  9. if (!docs) {
  10. return null
  11. }
  12. return (
  13. <React.Fragment>
  14. <Head>
  15. <title>
  16. {docs.displayName} | React Common
  17. </title>
  18. </Head>
  19. <h1>{docs.displayName}</h1>
  20. <p>
  21. {
  22. unified()
  23. .use(parse)
  24. .use(remark2react)
  25. .processSync(docs.description).result
  26. }
  27. </p>
  28. </React.Fragment>
  29. )
  30. }
  31. export default Header