Skip to content

Commit

Permalink
wrap in Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Apr 3, 2024
1 parent 7925c89 commit 57def8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import { components } from "https://unpkg.com/@wq/markdown";
import { Analyst } from "https://unpkg.com/@wq/analyst";

const React = modules.react;
const { Paper } = modules["@mui/material"];
const Code = components.code;

export default function CodeDetect(props) {
const { children: value } = props;
if (value.includes("// @wq/analyst")) {
const config = parseConfig(value);
if (config) {
return React.createElement(Analyst, config);
return React.createElement(
Paper,
null,
React.createElement(Analyst, config),
);
} else {
return React.createElement(Code, {
children: "// Error parsing @wq/analyst config\n\n" + value,
Expand Down

0 comments on commit 57def8f

Please sign in to comment.