@@ -23,6 +23,7 @@ import {
2323 validateGitHubUrl ,
2424 validateGitLabUrl ,
2525} from "@/lib/repo-tree-utils"
26+ import { convertMapToJson } from "@/lib/utils"
2627import type { TreeCustomizationOptions } from "@/types/tree-customization"
2728import { saveAs } from "file-saver"
2829import {
@@ -282,7 +283,7 @@ export default function RepoProjectStructure() {
282283 fileName = "directory-structure.txt"
283284 break
284285 case "json" :
285- content = JSON . stringify ( Array . from ( filteredStructureMap ) , null , 2 )
286+ content = JSON . stringify ( convertMapToJson ( filteredStructureMap ) , null , 2 )
286287 mimeType = "application/json;charset=utf-8"
287288 fileName = "directory-structure.json"
288289 break
@@ -336,8 +337,11 @@ export default function RepoProjectStructure() {
336337 >
337338 < CardHeader >
338339 < CardTitle className = "text-3xl md:text-4xl lg:text-5xl font-semibold text-black dark:text-white flex items-center justify-center gap-2" >
339- ASCII < span className = "text-blue-600" > Tree</ span > Generator
340+ Repo < span className = "text-blue-600" > Tree</ span > Generator
340341 </ CardTitle >
342+ < p className = "text-center text-muted-foreground text-base" >
343+ Generate and share clean ASCII trees of your GitHub & GitLab repositories .
344+ </ p >
341345 </ CardHeader >
342346 < CardContent >
343347 < div className = "space-y-6" >
@@ -471,8 +475,10 @@ export default function RepoProjectStructure() {
471475 </ Button >
472476 ) : (
473477 < Button
474- onClick = { copyToClipboard }
475- className = "p-2 text-white dark:text-gray-400 dark:hover:text-gray-900 bg-transparent border-none"
478+ onClick = { structureMap . size === 0 ? ( ) => { } : copyToClipboard }
479+ className = { `p-2 text-white dark:text-gray-400 dark:hover:text-gray-900 bg-transparent border-none ${
480+ structureMap . size === 0 ? "cursor-not-allowed opacity-50" : ""
481+ } `}
476482 aria-label = "Copy to clipboard"
477483 title = "Copy to clipboard"
478484 >
@@ -508,8 +514,10 @@ export default function RepoProjectStructure() {
508514 </ SelectContent >
509515 </ Select >
510516 < Button
511- onClick = { handleDownload }
512- className = "bg-blue-600 hover:bg-blue-700 text-white"
517+ onClick = { structureMap . size === 0 ? ( ) => { } : handleDownload }
518+ className = { `bg-blue-600 hover:bg-blue-700 text-white ${
519+ structureMap . size === 0 ? "cursor-not-allowed opacity-50" : ""
520+ } `}
513521 aria-label = "Download file"
514522 >
515523 < Download aria-hidden = "true" /> Download
0 commit comments