import { Folder, File } from 'lucide-react'
import { Link } from 'react-router-dom'
import { formatDistanceToNow } from 'date-fns'
import { Skeleton } from '@/components/ui/skeleton'
import { useRepo } from '@/lib/repo'
import type { GitTreeEntry } from '@/lib/gitApi'
interface FileTreeProps {
entries: GitTreeEntry[]
path: string
loading?: boolean
onNavigate: (entry: GitTreeEntry) => void
onNavigateUp: () => void
}
// Directory listing table for the code browser. Shows each entry's icon,
// name, last-commit message (linked to commit detail), and relative date.
export function FileTree({ entries, path, loading, onNavigate, onNavigateUp }: FileTreeProps) {
// Directories first, then files — each group alphabetical
const sorted = [...entries].sort((a, b) => {
if (a.type !== b.type) return a.type === 'tree' ? -1 : 1
return a.name.localeCompare(b.name)
})
if (loading) return
|
|
.. |