Implementiere Stornierungssystem und E-Mail-Links zur Hauptseite
- Neues Stornierungssystem mit sicheren Token-basierten Links - Stornierungsfrist konfigurierbar über MIN_STORNO_TIMESPAN (24h Standard) - Stornierungs-Seite mit Buchungsdetails und Ein-Klick-Stornierung - Automatische Slot-Freigabe bei Stornierung - Stornierungs-Link in Bestätigungs-E-Mails integriert - Alle E-Mails enthalten jetzt Links zur Hauptseite (DOMAIN Variable) - Schöne HTML-Buttons und Text-Links in allen E-Mail-Templates - Vollständige Validierung: Vergangenheits-Check, Token-Ablauf, Stornierungsfrist - Responsive Stornierungs-Seite mit Loading-States und Fehlerbehandlung - Dokumentation in README.md aktualisiert
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useAuth } from "@/client/components/auth-provider";
|
||||
import { LoginForm } from "@/client/components/login-form";
|
||||
import { UserProfile } from "@/client/components/user-profile";
|
||||
@@ -8,11 +8,34 @@ import { AdminBookings } from "@/client/components/admin-bookings";
|
||||
import { AdminCalendar } from "@/client/components/admin-calendar";
|
||||
import { InitialDataLoader } from "@/client/components/initial-data-loader";
|
||||
import { AdminAvailability } from "@/client/components/admin-availability";
|
||||
import CancellationPage from "@/client/components/cancellation-page";
|
||||
|
||||
function App() {
|
||||
const { user, isLoading, isOwner } = useAuth();
|
||||
const [activeTab, setActiveTab] = useState<"booking" | "admin-treatments" | "admin-bookings" | "admin-calendar" | "admin-availability" | "profile">("booking");
|
||||
|
||||
// Check for cancellation token in URL
|
||||
useEffect(() => {
|
||||
const path = window.location.pathname;
|
||||
if (path.startsWith('/cancel/')) {
|
||||
const token = path.split('/cancel/')[1];
|
||||
if (token) {
|
||||
// Set a special state to show cancellation page
|
||||
setActiveTab("cancellation" as any);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Handle cancellation page
|
||||
const path = window.location.pathname;
|
||||
if (path.startsWith('/cancel/')) {
|
||||
const token = path.split('/cancel/')[1];
|
||||
if (token) {
|
||||
return <CancellationPage token={token} />;
|
||||
}
|
||||
}
|
||||
|
||||
// Show loading spinner while checking authentication
|
||||
if (isLoading) {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user