diff --git a/src/components/scope/scope-item.tsx b/src/components/scope/scope-item.tsx index 83f519a..5a97c9d 100644 --- a/src/components/scope/scope-item.tsx +++ b/src/components/scope/scope-item.tsx @@ -1,11 +1,11 @@ import { Scope, Variable, Reference } from "eslint-scope"; +import { TreeEntry } from "../tree-entry"; +import type { FC } from "react"; import { AccordionContent, AccordionItem, AccordionTrigger, -} from "@/components/ui/accordion"; -import { TreeEntry } from "../tree-entry"; -import type { FC } from "react"; +} from "../ui/accordion"; type ScopeItemProperties = { isArray: boolean; @@ -41,25 +41,48 @@ export const ScopeItem: FC = ({ ([name]) => !name.startsWith("__"), ); + if (path.length === 1) { + return ( + + + {isArray && `${Math.max(index, 0)}.`} {key} + + +
+ {properties.map((item, index) => ( + + ))} +
+
+
+ ); + } + return ( - - +
+ +
+
+
+ {properties.map((item, index) => ( + + ))} +
- - +
+
); };