diff --git a/src/app/os/layout.tsx b/src/app/os/layout.tsx index 44f6f95..61447f4 100644 --- a/src/app/os/layout.tsx +++ b/src/app/os/layout.tsx @@ -40,7 +40,7 @@ export default function OSDetailLayout({ const handleTabChange = (tab: string) => { if (tab === "bin") return; - router.push(addBasePath(`/os/${tab}?os=${os}`)); + router.push(`/os/${tab}?os=${os}`); }; return ( diff --git a/src/components/filesystem.tsx b/src/components/filesystem.tsx index e746088..75427ed 100644 --- a/src/components/filesystem.tsx +++ b/src/components/filesystem.tsx @@ -21,6 +21,39 @@ function countItems(item: TreeWithFullPath): number { return count; } +function getMaxDepth(item: TreeWithFullPath, current = 0): number { + let max = current; + for (const value of Object.values(item)) { + if (typeof value !== "string") { + max = Math.max(max, getMaxDepth(value, current + 1)); + } + } + return max; +} + +function FileItem({ + name, + fullPath, + os, +}: { + name: string; + fullPath: string; + os: string; +}) { + return ( +