2026-06-17 16:02:04 -04:00
|
|
|
|
import ShiftSlot from './ShiftSlot'
|
|
|
|
|
|
|
|
|
|
|
|
const DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
|
|
|
|
|
|
|
2026-07-12 14:19:58 -04:00
|
|
|
|
export default function DayColumn({
|
|
|
|
|
|
date,
|
|
|
|
|
|
isToday,
|
|
|
|
|
|
activeShifts = new Set(),
|
|
|
|
|
|
shifts = {},
|
2026-07-13 02:10:25 -04:00
|
|
|
|
nextDayShift1 = [],
|
|
|
|
|
|
nextDayShift1Active = false,
|
2026-07-12 14:19:58 -04:00
|
|
|
|
showShift2 = false,
|
|
|
|
|
|
windowLookup = new Map(),
|
|
|
|
|
|
onWindowSelect,
|
|
|
|
|
|
}) {
|
2026-06-17 16:02:04 -04:00
|
|
|
|
const dayName = DAY_NAMES[date.getDay()]
|
|
|
|
|
|
const dayNum = date.getDate()
|
2026-07-12 14:19:58 -04:00
|
|
|
|
const dateKey = date.toISOString().slice(0, 10)
|
2026-06-17 16:02:04 -04:00
|
|
|
|
|
2026-07-12 14:19:58 -04:00
|
|
|
|
function getWindowForShift(shiftIndex) {
|
|
|
|
|
|
return windowLookup.get(`${dateKey}::shift${shiftIndex}`) ?? null
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const shift2Visible = showShift2 || shifts.shift2.length > 0 || Boolean(getWindowForShift(2))
|
2026-06-17 16:02:04 -04:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="flex flex-col min-w-0 flex-1 rounded-lg border border-gray-700 bg-gray-800/40">
|
|
|
|
|
|
{/* Day header — subtle today ring, no full-column highlight */}
|
|
|
|
|
|
<div
|
|
|
|
|
|
className={`text-center py-1.5 rounded-t-lg ${
|
|
|
|
|
|
isToday ? 'bg-gray-600 text-white' : 'bg-gray-700/60 text-gray-300'
|
|
|
|
|
|
}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<p className="text-[11px] font-semibold uppercase tracking-wide leading-none">
|
|
|
|
|
|
{dayName}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p className={`text-base font-bold leading-tight ${isToday ? 'text-white' : 'text-gray-100'}`}>
|
|
|
|
|
|
{dayNum}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Shifts */}
|
|
|
|
|
|
<div className="flex flex-col flex-1 px-0.5 py-1">
|
2026-07-12 14:19:58 -04:00
|
|
|
|
<ShiftSlot
|
|
|
|
|
|
label="9AM–5PM"
|
|
|
|
|
|
tests={shifts.shift2}
|
|
|
|
|
|
visible={true}
|
|
|
|
|
|
active={activeShifts.has(2)}
|
|
|
|
|
|
windowDetails={getWindowForShift(2)}
|
|
|
|
|
|
onWindowSelect={onWindowSelect}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<ShiftSlot
|
|
|
|
|
|
label="5PM–12AM"
|
|
|
|
|
|
tests={shifts.shift3}
|
|
|
|
|
|
visible={true}
|
|
|
|
|
|
active={activeShifts.has(3)}
|
|
|
|
|
|
windowDetails={getWindowForShift(3)}
|
|
|
|
|
|
onWindowSelect={onWindowSelect}
|
|
|
|
|
|
/>
|
2026-07-13 02:10:25 -04:00
|
|
|
|
<ShiftSlot
|
|
|
|
|
|
label="12AM–9AM (next day)"
|
|
|
|
|
|
tests={nextDayShift1}
|
|
|
|
|
|
visible={true}
|
|
|
|
|
|
active={nextDayShift1Active}
|
|
|
|
|
|
windowDetails={null}
|
|
|
|
|
|
onWindowSelect={onWindowSelect}
|
|
|
|
|
|
/>
|
2026-06-17 16:02:04 -04:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|