+ {/* 7 Background Day Cells with Clear Vertical Borders */}
+ {weekLayout.weekDays.map((day, colIdx) => {
+ const dateStr = day.format('YYYY-MM-DD');
+ const isCurrentMonth = day.month() === currentMonth.month();
+ const isToday = dateStr === todayStr;
+ const isSunday = colIdx === 0;
+ const hiddenCount = weekLayout.hiddenCountPerCol[colIdx];
- const dateLabel =
- day.date() === 1 ? day.format('D MMM') : String(day.date());
+ const dateLabel = day.date() === 1 ? day.format('D MMM') : String(day.date());
- return (
-
onSelectEmptyDate(dateStr)}
- style={{ minHeight: `${ROW_MIN_HEIGHT_PX}px` }}
- className={`group relative flex flex-col justify-between p-2 border-r last:border-r-0 border-zinc-200 dark:border-zinc-800 transition-colors cursor-pointer select-none ${
- isCurrentMonth
- ? 'bg-white dark:bg-zinc-900 hover:bg-zinc-50/80 dark:hover:bg-zinc-800/50'
- : 'bg-zinc-50/70 dark:bg-zinc-950/70 hover:bg-zinc-100/60 dark:hover:bg-zinc-900/60'
- }`}
- >
- {/* Top Row inside Cell: Date Badge & Hover Quick-Add Button */}
-
-
- {dateLabel}
-
+ return (
+
onSelectEmptyDate(dateStr)}
+ style={{ minHeight: `${ROW_MIN_HEIGHT_PX}px` }}
+ className={`group relative flex flex-col justify-between p-2 border-r last:border-r-0 border-zinc-200 dark:border-zinc-800 transition-colors cursor-pointer select-none ${isCurrentMonth
+ ? 'bg-white dark:bg-zinc-900 hover:bg-zinc-100 dark:hover:bg-zinc-800'
+ : 'bg-zinc-50/70 dark:bg-zinc-950/70 hover:bg-zinc-100/60 dark:hover:bg-zinc-900/60'
+ }`}
+ >
+ {/* Top Row inside Cell: Date Badge & Hover Quick-Add Button */}
+
+
+ {dateLabel}
+
-
-
+
+
- {/* Bottom Row inside Cell: "+X lainnya" overflow pill */}
-
- {hiddenCount > 0 && (
-
- )}
-
-
- );
- })}
+ {/* Bottom Row inside Cell: "+X lainnya" overflow pill */}
+
+ {hiddenCount > 0 && (
+
+ )}
+
+
+ );
+ })}
- {/* Continuous Horizontal Event Lanes Layer */}
-
- {weekLayout.visibleSegments.map((seg) => {
- const {
- event: ev,
- startCol,
- span,
- lane,
- isBar,
- continuesBefore,
- continuesAfter,
- } = seg;
- const hex = resolveEventColor(ev);
- const leftPercent = (startCol / 7) * 100;
- const widthPercent = (span / 7) * 100;
- const topPx = lane * LANE_HEIGHT_PX;
+ {/* Continuous Horizontal Event Lanes Layer */}
+
+ {weekLayout.visibleSegments.map((seg) => {
+ const {
+ event: ev,
+ startCol,
+ span,
+ lane,
+ isBar,
+ continuesBefore,
+ continuesAfter,
+ } = seg;
+ const hex = resolveEventColor(ev);
+ const leftPercent = (startCol / 7) * 100;
+ const widthPercent = (span / 7) * 100;
+ const topPx = lane * LANE_HEIGHT_PX;
- if (isBar) {
- const timePrefix = !ev.isAllDay
- ? `${formatGCalShortTime(ev.start)} `
- : '';
+ if (isBar) {
+ const timePrefix = !ev.isAllDay ? `${formatGCalShortTime(ev.start)} ` : '';
- const leftInset = continuesBefore ? 1 : 6;
- const rightInset = continuesAfter ? 1 : 6;
+ const leftInset = continuesBefore ? 1 : 6;
+ const rightInset = continuesAfter ? 1 : 6;
- return (
-
-
+
+ );
+ }
- // Single-day timed event pill
- const shortTime = formatGCalShortTime(ev.start);
+ // Single-day timed event pill
+ const shortTime = formatGCalShortTime(ev.start);
- return (
-
- {
- e.stopPropagation();
- onSelectEvent(ev);
- }}
- title={`${shortTime} ${ev.summary}${
- ev.calendarSummary ? ` • ${ev.calendarSummary}` : ''
- }`}
- className="w-full h-full px-2 rounded-md text-left text-[11px] bg-zinc-100/70 dark:bg-zinc-800/80 hover:bg-zinc-200/80 dark:hover:bg-zinc-700/90 border border-zinc-200/80 dark:border-zinc-700/70 transition-colors flex items-center gap-1.5 min-w-0"
- >
-
-
-
- {shortTime}
-
-
- {ev.summary}
-
-
-
-
- );
- })}
-
-