diff --git a/src/OrgAst.tsx b/src/OrgAst.tsx
index c2f1001..009215e 100644
--- a/src/OrgAst.tsx
+++ b/src/OrgAst.tsx
@@ -1,5 +1,4 @@
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: {
@@ -21,9 +20,10 @@ const OrgAst = (props: {
return (
@@ -34,29 +34,19 @@ const OrgAst = (props: {
const OrgAstNode = (props: {
selectNode: Function;
node: any;
- parentUniqueId: string;
+ uid: string;
selectedNode: string;
}) => {
- const uid =
- props.parentUniqueId +
- "_" +
- props.node["ast-node"] +
- "/" +
- props.node["standard-properties"]["begin"] +
- "/" +
- props.node["standard-properties"]["end"] +
- "#";
-
function selectNode() {
props.selectNode(
- uid,
+ props.uid,
props.node["standard-properties"]["begin"] - 1,
props.node["standard-properties"]["end"] - 1,
);
}
const nodeClassName =
- props.selectedNode === uid
+ props.selectedNode === props.uid
? styles.OrgAstNode + " " + styles.selected
: styles.OrgAstNode;
@@ -86,7 +76,7 @@ const OrgAstNode = (props: {
@@ -104,10 +94,20 @@ const OrgAstNodeList = (props: {
node_list: any[];
}): React.JSX.Element[] => {
return props.node_list.map((node) => {
+ const uid =
+ props.parentUniqueId +
+ "_" +
+ node["ast-node"] +
+ "/" +
+ node["standard-properties"]["begin"] +
+ "/" +
+ node["standard-properties"]["end"] +
+ "#";
return (