MCPcopy Create free account
hub / github.com/DimwitLabs/ode / Intro

Function Intro

src/components/Intro/Intro.jsx:6–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { parseMarkdown } from '../../utils/parseMarkdown';
5
6function Intro() {
7 const [intro, setIntro] = React.useState(null);
8 const [error, setError] = React.useState(null);
9
10 React.useEffect(() => {
11 parseMarkdown('/content/intro.md')
12 .then(({ content }) => setIntro(content))
13 .catch(setError);
14 }, []);
15
16 if (error) {
17 return <div style={{ color: 'red' }}>
18 Error loading intro: {error.message}
19 </div>;
20 }
21
22 if (!intro) {
23 return <div></div>;
24 }
25
26 return <div className="intro">
27 <ReactMarkdown>{intro}</ReactMarkdown>
28 </div>;
29}
30
31export default Intro;

Callers

nothing calls this directly

Calls 1

parseMarkdownFunction · 0.90

Tested by

no test coverage detected