[34288f42] Keine Zusammenfassung angegeben.

Keine Zusammenfassung angegeben.
This commit is contained in:
2026-04-14 08:37:51 +00:00
parent f148f40d9e
commit 2592607b04
13 changed files with 419 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ function App() {
const [eventTypes, setEventTypes] = useState<any[]>([]);
const [selectedEventType, setSelectedEventType] = useState<string>("");
const [isListGenerating, setIsListGenerating] = useState(false);
const [isSiblingsGenerating, setIsSiblingsGenerating] = useState(false);
const [reminderTaskId, setReminderTaskId] = useState<string | null>(null);
const [reminderProgress, setReminderProgress] = useState<string>('');
const [isReminderRunning, setIsReminderRunning] = useState(false);
@@ -321,6 +322,23 @@ function App() {
}
};
const handleGenerateSiblingsList = async (job: Job) => {
setIsSiblingsGenerating(true);
setError(null);
try {
const downloadUrl = `${API_BASE_URL}/api/jobs/${job.id}/siblings-list?account_type=${activeTab}&event_type_name=${encodeURIComponent(selectedEventType)}`;
window.open(downloadUrl, '_blank');
setTimeout(() => {
setIsSiblingsGenerating(false);
fetchLatestFile();
}, 3000);
} catch (err: any) {
setError(`Geschwisterlisten-Fehler (${job.name}): ${err.message}`);
setIsSiblingsGenerating(false);
}
};
const handleGenerateAppointmentList = async (job: Job) => {
setIsListGenerating(true);
setError(null);
@@ -763,6 +781,22 @@ function App() {
{isListGenerating ? 'Generiere...' : 'PDF Liste generieren'}
</button>
</div>
{/* Action 3: Siblings List */}
<div className="bg-gray-50 p-4 rounded-lg flex flex-col justify-between sm:col-span-2">
<div>
<h6 className="font-bold text-sm text-gray-800 mb-1">👨👩👧👦 Geschwisterliste (Einrichtungsintern)</h6>
<p className="text-xs text-gray-600 mb-3">Sucht nach Geschwisterkindern in der Einrichtung und gleicht diese mit Calendly ab.</p>
</div>
<button
onClick={() => handleGenerateSiblingsList(selectedJob)}
disabled={!selectedEventType || isSiblingsGenerating}
className="w-full px-3 py-2 bg-teal-600 text-white text-xs font-bold rounded-lg hover:bg-teal-700 disabled:opacity-50 transition-all flex justify-center items-center gap-2 mt-auto"
>
{isSiblingsGenerating ? 'Generiere...' : 'Geschwisterliste generieren'}
</button>
</div>
</div>
</div>
</div>