From 4847ec07d89ab2f15ab89073a09bf86f04c2eeff Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 23 Jan 2024 22:05:07 -0500 Subject: [PATCH] Render if the node has children. --- src/OrgAst.module.css | 7 ++++++- src/OrgAst.tsx | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/OrgAst.module.css b/src/OrgAst.module.css index 982caae..36792e0 100644 --- a/src/OrgAst.module.css +++ b/src/OrgAst.module.css @@ -1,9 +1,14 @@ .OrgAst { flex: 1; - background: green; + background: #eeeeee; + padding: 5px; + overflow: scroll; } .OrgAstNode { + border: 1px solid #000000; + background: #ffffff; + padding: 5px; } .OrgAstNodeType { diff --git a/src/OrgAst.tsx b/src/OrgAst.tsx index 6d68b56..2332548 100644 --- a/src/OrgAst.tsx +++ b/src/OrgAst.tsx @@ -25,6 +25,9 @@ const OrgAstNode = (props: {node: any}) => { return (
{props.node["ast-node"]}
+ {Array.isArray(props.node.children) && props.node.children.length > 0 ? (<> + Has children + ) : null}
); }