RichSlideSection.tsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React, { ReactNode } from 'react';
  2. type RichSlideSectionProps = {
  3. children: ReactNode,
  4. presentation?: boolean,
  5. }
  6. const OriginalRichSlideSection = React.memo((props: RichSlideSectionProps): JSX.Element => {
  7. const { children, presentation } = props;
  8. return (
  9. <section className={presentation ? 'm-2' : 'shadow rounded m-2'}>
  10. <svg data-marpit-svg="" viewBox="0 0 1280 720">
  11. <foreignObject width="1280" height="720">
  12. <section>
  13. {children}
  14. </section>
  15. </foreignObject>
  16. </svg>
  17. </section>
  18. );
  19. });
  20. export const RichSlideSection = React.memo((props: RichSlideSectionProps): JSX.Element => {
  21. const { children } = props;
  22. return (
  23. <OriginalRichSlideSection>
  24. {children}
  25. </OriginalRichSlideSection>
  26. );
  27. });
  28. export const PresentationRichSlideSection = React.memo((props: RichSlideSectionProps): JSX.Element => {
  29. const { children } = props;
  30. return (
  31. <OriginalRichSlideSection presentation>
  32. {children}
  33. </OriginalRichSlideSection>
  34. );
  35. });