import { useState } from "react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { ChevronRight, ChevronDown, FileText, Folder } from "lucide-react"; import filesToTree, { type TreeWithFullPath } from "@/lib/tree"; import Link from "next/link"; function countItems(item: TreeWithFullPath): number { let count = 0; for (const value of Object.values(item)) { if (typeof value === "string") { count++; } else { count += countItems(value); } } return count; } function Tree({ item, os, depth, expandAll, }: { item: TreeWithFullPath; os: string; depth: number; expandAll: boolean; }) { return (