fix: show jury group selector at top of assignments tab when none assigned
Previously showed "Select a jury group below" but the selector was buried at the bottom (or not rendered at all when no jury was assigned). Now shows the actual dropdown + "New Jury" button right where the empty state message was. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1787,8 +1787,48 @@ export default function RoundDetailPage() {
|
||||
{/* 1. Jury Members & Progress (merged) */}
|
||||
{!round?.juryGroupId ? (
|
||||
<Card>
|
||||
<CardContent className="py-8 text-center">
|
||||
<p className="text-sm text-muted-foreground">Select a jury group below to get started.</p>
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<CardTitle className="text-base">Jury Group</CardTitle>
|
||||
<CardDescription>
|
||||
Select or create a jury group to get started
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Button size="sm" variant="outline" onClick={() => setCreateJuryOpen(true)}>
|
||||
<Plus className="h-4 w-4 mr-1.5" />
|
||||
New Jury
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{juryGroups && juryGroups.length > 0 ? (
|
||||
<Select
|
||||
value="__none__"
|
||||
onValueChange={(value) => {
|
||||
if (value !== '__none__') {
|
||||
assignJuryMutation.mutate({ id: roundId, juryGroupId: value })
|
||||
}
|
||||
}}
|
||||
disabled={assignJuryMutation.isPending}
|
||||
>
|
||||
<SelectTrigger className="w-full sm:w-80">
|
||||
<SelectValue placeholder="Select jury group..." />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="__none__">No jury assigned</SelectItem>
|
||||
{juryGroups.map((jg: any) => (
|
||||
<SelectItem key={jg.id} value={jg.id}>
|
||||
{jg.name} ({jg._count?.members ?? 0} members)
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
No jury groups exist yet. Create one to get started.
|
||||
</p>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user