Move hasHeaderMenu out of IIFE into component body

Computing it before the return statement is the right place since it only
depends on props, not loop variables. Removes the IIFE entirely and fixes
the indentation of the map callback body.

https://claude.ai/code/session_017JCShLVs9xZ6FZmyrUFaE1
This commit is contained in:
Claude 2026-04-25 09:14:04 +00:00
parent a2cbedbb82
commit 8a4c75e860
No known key found for this signature in database

View file

@ -142,6 +142,8 @@ export const MiniDraftGrid = memo(function MiniDraftGrid({
if (draftGrid.length === 0) return null; if (draftGrid.length === 0) return null;
const hasHeaderMenu = !!(onAdjustTimeBankOpen || onSetAutodraftOpen);
// h-14 (56px) + gap-1.5 (6px) fallback until first measurement // h-14 (56px) + gap-1.5 (6px) fallback until first measurement
const effectiveRowHeight = rowHeight > 0 ? rowHeight : 56; const effectiveRowHeight = rowHeight > 0 ? rowHeight : 56;
@ -154,9 +156,7 @@ export const MiniDraftGrid = memo(function MiniDraftGrid({
<div className="inline-block min-w-full"> <div className="inline-block min-w-full">
{/* Team header */} {/* Team header */}
<div className="flex gap-1.5 mb-1.5"> <div className="flex gap-1.5 mb-1.5">
{(() => { {draftSlots.map((slot) => {
const hasHeaderMenu = !!(onAdjustTimeBankOpen || onSetAutodraftOpen);
return draftSlots.map((slot) => {
const teamTime = teamTimers[slot.team.id]; const teamTime = teamTimers[slot.team.id];
const isAutodraft = autodraftStatus[slot.team.id]?.isEnabled ?? false; const isAutodraft = autodraftStatus[slot.team.id]?.isEnabled ?? false;
const isConnected = connectedTeams ? connectedTeams.has(slot.team.id) : true; const isConnected = connectedTeams ? connectedTeams.has(slot.team.id) : true;
@ -206,8 +206,7 @@ export const MiniDraftGrid = memo(function MiniDraftGrid({
{headerContent} {headerContent}
</div> </div>
); );
}); })}
})()}
</div> </div>
{/* Rows — clipped to 2-row height, slides to reveal new round */} {/* Rows — clipped to 2-row height, slides to reveal new round */}