feat(web): show participant position counts
This commit is contained in:
1 parent
b711c63dcd
commit
ad84bf1f89
1 file changed
+18
-6
@@ -471,9 +471,9 @@ function ParticipantRow({
|
|||||||
onChange={handleSubChange}
|
onChange={handleSubChange}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-2 px-3 text-right">
|
<td className="py-2 px-3 w-20 min-w-[5rem] whitespace-nowrap text-right">
|
||||||
{confirmingRemove ? (
|
{confirmingRemove ? (
|
||||||
<span className="inline-flex items-center gap-1.5">
|
<span className="inline-flex items-center gap-1.5 whitespace-nowrap">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={admin.isRemoving}
|
disabled={admin.isRemoving}
|
||||||
@@ -599,6 +599,14 @@ function ParticipantTable({
|
|||||||
).length,
|
).length,
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
const positionCounts = new Map<Position, number>(
|
||||||
|
POSITION_ORDER.map((position) => [
|
||||||
|
position,
|
||||||
|
participants.filter(
|
||||||
|
(participant) => participant.mainPosition === position,
|
||||||
|
).length,
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="border border-base-content/10 bg-base-100 overflow-hidden">
|
<div className="border border-base-content/10 bg-base-100 overflow-hidden">
|
||||||
@@ -627,16 +635,17 @@ function ParticipantTable({
|
|||||||
: "border-base-content/10 text-base-content/40 hover:text-base-content/70"
|
: "border-base-content/10 text-base-content/40 hover:text-base-content/70"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
전체
|
전체 ({participants.length})
|
||||||
</button>
|
</button>
|
||||||
{POSITION_ORDER.map((position) => {
|
{POSITION_ORDER.map((position) => {
|
||||||
const active = positionFilter === position;
|
const active = positionFilter === position;
|
||||||
|
const count = positionCounts.get(position) ?? 0;
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={position}
|
key={position}
|
||||||
type="button"
|
type="button"
|
||||||
title={positionLabel[position]}
|
title={`${positionLabel[position]} (${count}명)`}
|
||||||
aria-label={positionLabel[position]}
|
aria-label={`${positionLabel[position]} (${count}명)`}
|
||||||
aria-pressed={active}
|
aria-pressed={active}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setPositionFilter(
|
setPositionFilter(
|
||||||
@@ -657,6 +666,7 @@ function ParticipantTable({
|
|||||||
<span className="hidden sm:inline">
|
<span className="hidden sm:inline">
|
||||||
{positionLabel[position]}
|
{positionLabel[position]}
|
||||||
</span>
|
</span>
|
||||||
|
<span className="tabular-nums">({count})</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -703,7 +713,9 @@ function ParticipantTable({
|
|||||||
<th className="py-2 px-3">주 포지션</th>
|
<th className="py-2 px-3">주 포지션</th>
|
||||||
<th className="py-2 px-3">부 포지션</th>
|
<th className="py-2 px-3">부 포지션</th>
|
||||||
{canManage && (
|
{canManage && (
|
||||||
<th className="py-2 px-3 w-10 text-right">관리</th>
|
<th className="py-2 px-3 w-20 min-w-[5rem] whitespace-nowrap text-right">
|
||||||
|
관리
|
||||||
|
</th>
|
||||||
)}
|
)}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
Reference in new issue
Block a user