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
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:
45
src/components/shared/sortable-header.tsx
Normal file
45
src/components/shared/sortable-header.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user