2021-07-07 23:50:57 +03:00
|
|
|
import { H1, H2, H3, H4, P1, UL, OL, LI, A } from "~/components/system/components/Typography";
|
2020-11-26 02:19:02 +03:00
|
|
|
|
|
|
|
import { Markdown } from "~/components/system/components/Markdown";
|
|
|
|
|
|
|
|
const ProcessedText = ({ text, dark }) => {
|
|
|
|
const remarkReactComponents = {
|
2021-07-07 23:50:57 +03:00
|
|
|
h1: P1,
|
|
|
|
h2: P1,
|
|
|
|
h3: P1,
|
|
|
|
h4: P1,
|
|
|
|
h5: P1,
|
|
|
|
h6: P1,
|
2020-11-26 02:19:02 +03:00
|
|
|
ol: OL,
|
|
|
|
ul: UL,
|
|
|
|
li: LI,
|
2021-07-07 23:50:57 +03:00
|
|
|
a: (props) => <A dark={dark} {...props} />,
|
2020-11-26 02:19:02 +03:00
|
|
|
};
|
|
|
|
return <Markdown md={text} options={{ remarkReactComponents }} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ProcessedText;
|