Design system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
703 B

  1. import {GetStaticProps, NextPage} from 'next';
  2. import {getReadmeText} from '../src/data';
  3. import ReactMarkdown from 'react-markdown';
  4. import {Wrapper} from '../components/Wrapper';
  5. interface IndexPageProps {
  6. readmeType: 'markdown';
  7. readmeText: string;
  8. }
  9. const IndexPage: NextPage<IndexPageProps> = ({
  10. readmeType,
  11. readmeText,
  12. }) => {
  13. return (
  14. <Wrapper>
  15. {readmeType === 'markdown' && (
  16. <ReactMarkdown>
  17. {readmeText}
  18. </ReactMarkdown>
  19. )}
  20. </Wrapper>
  21. );
  22. };
  23. export const getStaticProps: GetStaticProps<IndexPageProps> = async () => {
  24. const readmeText = await getReadmeText();
  25. return {
  26. props: {
  27. readmeType: 'markdown',
  28. readmeText,
  29. },
  30. };
  31. };
  32. export default IndexPage;