1a0fe18e89
Führt das getrennte React/Vite-Frontend und Express/MongoDB-Backend in eine einzelne Next.js-Anwendung zusammen: - UI: React-Client-Komponenten (TabLayout, AppointmentForm, -List, ConfirmationModal) im Look von werte-next (Farben #CCCCFF/#85B7D7/ #FFFFDD, Rahmenbox, Tabellen-Liste, Footer mit Version/Datum) - API: Next.js Route Handler unter /api/appointments (GET/POST/PUT/DELETE, Soft-Delete beibehalten) - DB: MongoDB via lib/db.ts (gecachter Client, Standard appointmentsdb) - Tailwind 4 + TypeScript, Standalone-Docker-Build wie werte-next - Druckansicht der aktuellen offenen Termine beibehalten - Deployment: Dockerfile (multi-stage), docker-compose(.prod), deploy.sh Entfernt die alten frontend/- und backend/-Verzeichnisse. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
'use client';
|
|
|
|
interface ConfirmationModalProps {
|
|
isOpen: boolean;
|
|
title?: string;
|
|
message: string;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
export default function ConfirmationModal({
|
|
isOpen,
|
|
title,
|
|
message,
|
|
onConfirm,
|
|
onCancel,
|
|
}: ConfirmationModalProps) {
|
|
if (!isOpen) return null;
|
|
|
|
return (
|
|
<div
|
|
className="fixed inset-0 z-50 flex items-center justify-center bg-black/40"
|
|
onClick={onCancel}
|
|
>
|
|
<div
|
|
className="bg-white border border-gray-300 rounded-lg shadow-lg p-6 w-80 text-center"
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
{title && (
|
|
<h3 className="text-lg font-semibold text-gray-900 mb-3">{title}</h3>
|
|
)}
|
|
<p className="mb-6 text-gray-800 font-medium">{message}</p>
|
|
<div className="flex justify-center gap-4">
|
|
<button
|
|
onClick={onConfirm}
|
|
className="bg-red-500 hover:bg-red-600 text-white font-medium py-1.5 px-6 rounded-lg transition-colors"
|
|
>
|
|
Löschen
|
|
</button>
|
|
<button
|
|
onClick={onCancel}
|
|
className="bg-[#85B7D7] hover:bg-[#6a9fc5] text-black font-medium py-1.5 px-6 rounded-lg transition-colors"
|
|
>
|
|
Abbrechen
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|