feat: add chair toggle to admin award juror management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -477,6 +477,13 @@ export default function AwardDetailPage({
|
||||
const removeJuror = trpc.specialAward.removeJuror.useMutation({
|
||||
onSuccess: () => utils.specialAward.listJurors.invalidate({ awardId }),
|
||||
})
|
||||
const setChair = trpc.specialAward.setChair.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.specialAward.listJurors.invalidate({ awardId })
|
||||
toast.success('Chair status updated')
|
||||
},
|
||||
onError: () => toast.error('Failed to update chair status'),
|
||||
})
|
||||
const setWinner = trpc.specialAward.setWinner.useMutation({
|
||||
onSuccess: invalidateAward,
|
||||
})
|
||||
@@ -1328,6 +1335,7 @@ export default function AwardDetailPage({
|
||||
<TableRow>
|
||||
<TableHead>Member</TableHead>
|
||||
<TableHead>Role</TableHead>
|
||||
<TableHead>Chair</TableHead>
|
||||
<TableHead className="text-right">Actions</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
@@ -1352,6 +1360,15 @@ export default function AwardDetailPage({
|
||||
{j.user.role.replace('_', ' ')}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Switch
|
||||
checked={j.isChair}
|
||||
onCheckedChange={(checked) =>
|
||||
setChair.mutate({ awardId, userId: j.userId, isChair: checked })
|
||||
}
|
||||
disabled={setChair.isPending}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
Reference in New Issue
Block a user