import React, { useState } from "react"; import { useQuery } from "@tanstack/react-query"; export default function LegalPage() { const [activeSection, setActiveSection] = useState<"impressum" | "datenschutz">("impressum"); const { data: legalConfig, isLoading, error } = useQuery({ queryKey: ["legal", "config"], queryFn: async () => { console.log("Fetching legal config..."); try { const response = await fetch("/api/legal-config"); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const result = await response.json(); console.log("Legal config result:", result); return result; } catch (err) { console.error("Legal config error:", err); throw err; } }, retry: false, }); if (isLoading) { return (
Die rechtlichen Informationen konnten nicht geladen werden.
{error && (
<>
Fehler: {error.message}>
)}
Impressum und Datenschutz
{legalConfig.companyName}
Inhaber: {legalConfig.ownerName}
{legalConfig.address.street}
{legalConfig.address.postalCode} {legalConfig.address.city}
{legalConfig.address.country}
Telefon: {legalConfig.contact.phone}
E-Mail: {legalConfig.contact.email}
Website: {legalConfig.contact.website}
{legalConfig.businessDetails.taxId && (
<>Steuernummer: {legalConfig.businessDetails.taxId}
>
)}
{legalConfig.businessDetails.vatId && (
<>USt-IdNr.: {legalConfig.businessDetails.vatId}
>
)}
{legalConfig.businessDetails.commercialRegister && (
<>Handelsregister: {legalConfig.businessDetails.commercialRegister}
>
)}
Verantwortlich für den Inhalt: {legalConfig.businessDetails.responsibleForContent}
Die Inhalte unserer Seiten wurden mit größter Sorgfalt erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich.
{legalConfig.dataProtection.responsiblePerson}
E-Mail: {legalConfig.dataProtection.email}
{legalConfig.dataProtection.purpose}
{legalConfig.dataProtection.legalBasis}
{legalConfig.dataProtection.dataRetention}
{legalConfig.dataProtection.rights}
{legalConfig.dataProtection.cookies}
{legalConfig.dataProtection.dataSecurity}
{legalConfig.dataProtection.contactDataProtection}