Fix TypeScript build errors

- Remove unused variables (allFolders, getFolderDepth, hasChildren, legacyCategories)
- Fix Lucide icon title prop by wrapping in span elements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-02 01:39:32 -05:00
parent fafdaa50a5
commit dbd38afb73
4 changed files with 7 additions and 19 deletions

View File

@@ -38,10 +38,7 @@ export function AddToFolderMenu({ treeId, onFolderCreated }: AddToFolderMenuProp
const loadFoldersAndAssignments = async () => {
setIsLoading(true)
try {
const [foldersData, allFolders] = await Promise.all([
foldersApi.list(),
Promise.resolve([]), // Will load tree's folder assignments below
])
const foldersData = await foldersApi.list()
setFolders(foldersData)
// Check which folders contain this tree

View File

@@ -46,18 +46,6 @@ function buildFolderTree(folders: FolderListItem[]): FolderTreeItem[] {
return rootFolders
}
// Calculate folder depth (for limiting nesting)
function getFolderDepth(folders: FolderListItem[], folderId: string): number {
const folder = folders.find((f) => f.id === folderId)
if (!folder || !folder.parent_id) return 1
return 1 + getFolderDepth(folders, folder.parent_id)
}
// Check if folder has children
function hasChildren(folders: FolderListItem[], folderId: string): boolean {
return folders.some((f) => f.parent_id === folderId)
}
// Get all descendant IDs (for cascade delete warning)
function getDescendantIds(folders: FolderListItem[], folderId: string): string[] {
const children = folders.filter((f) => f.parent_id === folderId)

View File

@@ -24,7 +24,6 @@ export function TreeMetadataForm() {
} = useTreeEditorStore()
const [categories, setCategories] = useState<CategoryListItem[]>([])
const [legacyCategories, setLegacyCategories] = useState<string[]>([])
const [customCategory, setCustomCategory] = useState(false)
// Load categories

View File

@@ -274,9 +274,13 @@ export function TreeLibraryPage() {
<h3 className="font-semibold text-card-foreground">{tree.name}</h3>
<div className="flex items-center gap-2">
{tree.is_public ? (
<Globe className="h-4 w-4 text-muted-foreground" title="Public tree" />
<span title="Public tree">
<Globe className="h-4 w-4 text-muted-foreground" />
</span>
) : (
<Lock className="h-4 w-4 text-muted-foreground" title="Private tree" />
<span title="Private tree">
<Lock className="h-4 w-4 text-muted-foreground" />
</span>
)}
{tree.category_info && (
<span className="rounded-full bg-secondary px-2 py-0.5 text-xs text-secondary-foreground">