feat: min/max participants — shared ParticipantLimits component
- New ParticipantLimits component in FormField.tsx (reusable) - Used in both Open Day settings and MC editor — identical layout - Open Day: event-level min/max (DB migration 15) - MC: per-event min/max (JSON fields) - Public: waiting list when full, spots counter, amber success modal
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useRef, useEffect, useMemo } from "react";
|
||||
import { SectionEditor } from "../_components/SectionEditor";
|
||||
import { InputField, TextareaField } from "../_components/FormField";
|
||||
import { InputField, TextareaField, ParticipantLimits } from "../_components/FormField";
|
||||
import { ArrayEditor } from "../_components/ArrayEditor";
|
||||
import { Plus, X, Upload, Loader2, ImageIcon, AlertCircle, Check } from "lucide-react";
|
||||
import { adminFetch } from "@/lib/csrf";
|
||||
@@ -609,6 +609,13 @@ export default function MasterClassesEditorPage() {
|
||||
}
|
||||
/>
|
||||
|
||||
<ParticipantLimits
|
||||
min={item.minParticipants ?? 0}
|
||||
max={item.maxParticipants ?? 0}
|
||||
onMinChange={(v) => updateItem({ ...item, minParticipants: v })}
|
||||
onMaxChange={(v) => updateItem({ ...item, maxParticipants: v })}
|
||||
/>
|
||||
|
||||
</div>
|
||||
)}
|
||||
createItem={() => ({
|
||||
|
||||
Reference in New Issue
Block a user