"use client"; import { useState } from "react"; import type { AllocationConflictCheckResult } from "@nexus/shared"; const INITIAL_ROWS_SHOWN = 5; interface ConflictWarningPanelProps { result: AllocationConflictCheckResult; isLoading: boolean; acknowledged: boolean; onAcknowledge: (v: boolean) => void; } export function ConflictWarningPanel({ result, isLoading, acknowledged, onAcknowledge, }: ConflictWarningPanelProps) { const [showAllDays, setShowAllDays] = useState(false); if (isLoading) { return (
⚠ Overbooking on {result.overbooking.totalConflictDays} day {result.overbooking.totalConflictDays !== 1 ? "s" : ""} (up to{" "} {result.overbooking.maxOverbookPercent}% over capacity)
The resource already has allocations that exceed their daily capacity on the following days. You can still save — check the box below to confirm.
{/* Day-by-day table */}| Date | Capacity | Booked | New | Over |
|---|---|---|---|---|
| {day.date} | {day.availableHours}h | {day.existingHours}h | {day.requestedHours}h | +{day.overageHours.toFixed(1)}h |
ℹ Resource has approved leave during this period
Vacation days are excluded from billable hours and daily cost calculations.