feat: fix project status counts, add top pagination and sortable columns
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m39s

- Status counts now show each project's latest round state only
  (no more inflated counts from projects passing multiple rounds)
- Add pagination controls at top of projects, members, and observer lists
- Add sortable column headers to admin projects table (title, category,
  program, assignments, status) and members table (name, role, status,
  last login)
- Backend: add sortBy/sortDir params to project.list and user.list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 14:49:17 +01:00
parent 2be7318cb9
commit fd2624f198
6 changed files with 173 additions and 13 deletions

View File

@@ -0,0 +1,45 @@
'use client'
import { TableHead } from '@/components/ui/table'
import { cn } from '@/lib/utils'
import { ArrowUpDown, ArrowUp, ArrowDown } from 'lucide-react'
type SortableHeaderProps = {
label: string
column: string
currentSort?: string
currentDir?: 'asc' | 'desc'
onSort: (column: string) => void
className?: string
}
export function SortableHeader({
label,
column,
currentSort,
currentDir,
onSort,
className,
}: SortableHeaderProps) {
const isActive = currentSort === column
return (
<TableHead
className={cn('cursor-pointer select-none hover:bg-muted/50 transition-colors', className)}
onClick={() => onSort(column)}
>
<div className="flex items-center gap-1">
{label}
{isActive ? (
currentDir === 'asc' ? (
<ArrowUp className="h-3.5 w-3.5 text-foreground" />
) : (
<ArrowDown className="h-3.5 w-3.5 text-foreground" />
)
) : (
<ArrowUpDown className="h-3.5 w-3.5 text-muted-foreground/50" />
)}
</div>
</TableHead>
)
}