import React from 'react' /** * Modal: geplante Einheiten aus einem Trainingsrahmenprogramm (Blueprint-Slots) erzeugen. */ export default function TrainingPlanningFrameworkImportModal({ open, frameworkProgramsList, fwImportProgramId, onProgramChange, fwImportLoading, fwImportDetail, fwImportSelectedSlots, onToggleSlot, fwImportSlotDates, onSlotDateChange, fwImportStartDate, onFwImportStartDateChange, fwImportIntervalDays, onFwImportIntervalDaysChange, fwImportSubmitting, onApplyDateSuggestions, onSubmit, onClose, }) { if (!open) return null return (

Sessions aus Rahmen übernehmen

Wähle ein Trainingsrahmenprogramm und eine oder mehrere Sessions. Pro Session entsteht eine{' '} eigene geplante Einheit in der aktuellen Gruppe (Kopie des Ablaufs). Die{' '} Verknüpfung zum Rahmen-Slot wird gespeichert, damit die Herkunft sichtbar bleibt.

{fwImportLoading ? (

Laden der Sessions…

) : fwImportDetail?.slots?.length ? ( <>
Sessions (mit Ablauf)
    {[...fwImportDetail.slots] .sort((a, b) => (a.sort_order ?? 0) - (b.sort_order ?? 0)) .map((slot) => { const hasBp = !!slot.blueprint_training_unit_id const checked = fwImportSelectedSlots.has(slot.id) const label = (slot.title || '').trim() || `Session ${(slot.sort_order ?? 0) + 1}` return (
  • ) })}
onFwImportStartDateChange(e.target.value)} disabled={fwImportSubmitting} />
onFwImportIntervalDaysChange(parseInt(e.target.value, 10) || 0)} disabled={fwImportSubmitting} />
) : fwImportProgramId ? (

Keine Sessions in diesem Programm.

) : null}
) }