import { Link, useLocation } from 'react-router-dom'; import DynamicIcon from './DynamicIcon.jsx'; import { useCookieConsent } from '../context/CookieConsentContext.jsx'; import { useSiteSettings } from '../context/SiteSettingsContext.jsx'; const digitsOnly = (value) => (value || '').replace(/[^\d+]/g, ''); const SHOP_ADDRESS_ENCODED = encodeURIComponent('Boxbrunner Str. 20a, 63916 Amorbach'); const DIRECTIONS_URL = `https://www.google.com/maps/dir/?api=1&destination=${SHOP_ADDRESS_ENCODED}`; const HOURS = [ { days: 'Montag – Freitag', from: 9 * 60, to: 18 * 60, label: '9:00–18:00 Uhr' }, { days: 'Samstag', from: 10 * 60, to: 13 * 60, label: '10:00–13:00 Uhr' }, { days: 'Sonntag', from: null, to: null, label: 'Geschlossen' }, ]; function isOpenNow() { const now = new Date(); const minutes = now.getHours() * 60 + now.getMinutes(); const day = now.getDay(); // 0 = Sonntag, 1-5 = Mo-Fr, 6 = Sa const todayHours = day === 0 ? HOURS[2] : day === 6 ? HOURS[1] : HOURS[0]; return todayHours.from !== null && minutes >= todayHours.from && minutes < todayHours.to; } export default function Footer() { const open = isOpenNow(); const { openSettings } = useCookieConsent(); // Auf der Startseite blendet sich unten eine fixierte CTA-Leiste ein, die // sonst die letzte Footer-Zeile (Impressum-Links) verdeckt - deshalb dort // zusätzlichen Platz für sie freihalten. const { pathname } = useLocation(); const isHome = pathname === '/'; const { phone, contact_email: contactEmail } = useSiteSettings(); return ( ); }