import React, { ReactNode, useState } from "react"; import { parse_org } from "../../organic/target/wasm32-unknown-unknown/js/wasm"; import styles from "./OrgAst.module.css"; const OrgAst = (props: { addHighlight: Function; value: string }) => { console.log(styles); const ast_tree = parse_org(props.value); console.log(JSON.stringify(ast_tree)); if (ast_tree.status !== "success") { return
Error! {ast_tree.content}
; } else { return (
); } }; const OrgAstNode = (props: { node: any }) => { return (
{props.node["ast-node"]}
{Array.isArray(props.node.children) && props.node.children.length > 0 ? ( <>Has children ) : null}
); }; export default OrgAst;