18a3afa28SCedric van Puttenimport React, { PropsWithChildren, useEffect } from 'react';
28a3afa28SCedric van Putten
3*a16a3d18SBartosz Kaszubowskiimport { H3 } from '~/ui/components/Text';
48a3afa28SCedric van Putten
58a3afa28SCedric van Puttentype Props = PropsWithChildren<object>;
68a3afa28SCedric van Putten
78a3afa28SCedric van Puttenexport const ConfigPluginExample = ({ children }: Props) => {
88a3afa28SCedric van Putten  useEffect(() => {
98a3afa28SCedric van Putten    if (typeof children === 'string') {
108a3afa28SCedric van Putten      throw new Error(
118a3afa28SCedric van Putten        `Content inside 'ConfigPluginExample' needs to be surrounded by new lines to be parsed as markdown.\n\nMake sure there is a blank new line before and after this content: '${children}'`
128a3afa28SCedric van Putten      );
138a3afa28SCedric van Putten    }
148a3afa28SCedric van Putten  }, [children]);
158a3afa28SCedric van Putten
168a3afa28SCedric van Putten  return (
178a3afa28SCedric van Putten    <>
188a3afa28SCedric van Putten      <H3>Example app.json with config plugin</H3>
198a3afa28SCedric van Putten      {children}
208a3afa28SCedric van Putten    </>
218a3afa28SCedric van Putten  );
228a3afa28SCedric van Putten};
23