"use client"; import { useState, useTransition } from "react"; import { Mail } from "lucide-react"; import { toast } from "sonner"; import { Switch } from "@/src/components/ui/switch"; import { setMyStudioConsent, type StudioConsentRow } from "../../actions/consent-actions"; interface StudioEmailsSettingsViewProps { initialStudios: StudioConsentRow[]; } const StudioEmailsSettingsView = ({ initialStudios }: StudioEmailsSettingsViewProps) => { const [studios, setStudios] = useState(initialStudios); const [, startSaving] = useTransition(); const toggle = (businessId: string, granted: boolean) => { const update = (value: boolean) => setStudios((rows) => rows.map((row) => (row.businessId === businessId ? { ...row, granted: value } : row)) ); update(granted); startSaving(async () => { const result = await setMyStudioConsent(businessId, granted); if (!result.success) { update(!granted); toast.error(result.error); } }); }; return (
Legen Sie fest, welche Studios Ihnen Angebote und Glückwünsche schicken dürfen. Buchungs- und Zahlungsbestätigungen bekommen Sie immer.
Sobald Sie bei einem Studio gebucht haben, erscheint es hier.
{studio.studioName}
{studio.label}