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:
parent
a2cbedbb82
commit
8a4c75e860
1 changed files with 50 additions and 51 deletions
|
|
@ -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 */}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue