diff --git a/src/components/SelectionInfo/index.tsx b/src/components/SelectionInfo/index.tsx index af21f1c9..d88f3527 100644 --- a/src/components/SelectionInfo/index.tsx +++ b/src/components/SelectionInfo/index.tsx @@ -1,5 +1,5 @@ import { NodeChange, ReactFlowProvider, useReactFlow } from "reactflow"; -import { Level, TypeOrKind } from "@/primer-api"; +import { Tree, Level, TypeOrKind } from "@/primer-api"; import { TreeReactFlowOne } from "@/components"; import { TreeReactFlowOneProps, @@ -13,7 +13,7 @@ export type SelectionInfoProps = { }; const TypeOrKindTree = (p: { - typeOrKind: TypeOrKind; + typeOrKind: Tree; level: Level; extraTreeProps: Partial; }) => { @@ -23,11 +23,10 @@ const TypeOrKindTree = (p: { fitView({ padding }); }; - const tk = p.typeOrKind.contents; return ( ; +}) => { + return ( +
+
+ {title} +
+
+ + + +
+
+ ); +}; + export const SelectionInfo = ({ typeOrKind, level, @@ -44,22 +72,30 @@ export const SelectionInfo = ({ }: SelectionInfoProps): JSX.Element => { return (
- {typeOrKind && ( - <> -
- Type -
-
- - - -
- - )} + {typeOrKind && + (typeOrKind.contents.tag === "Ok" ? ( + + ) : ( + <> + + + + ))}
); };