import { useEffect } from 'react'; import NotificationPanel from './NotificationPanel'; const DashboardView = ({ session, onRefresh, onLogout, notificationPanelOpen, onToggleNotificationPanel, notificationProps, stores, availableCollapsed, onToggleStores, onStoreSelect, configMap, error, onDismissError, status, visibleConfig, config, onToggleActive, onToggleProfileCheck, onToggleOnlyNotify, onWeekdayChange, weekdays, onRangePickerRequest, formatRangeLabel, onSaveConfig, onResetConfig, onHideEntry, onDeleteEntry, canDelete, focusedStoreId, onClearFocus }) => { useEffect(() => { if (!focusedStoreId) { return; } const row = document.querySelector(`[data-store-row="${focusedStoreId}"]`); if (!row) { onClearFocus(); return; } row.scrollIntoView({ behavior: 'smooth', block: 'center' }); row.classList.add('ring-2', 'ring-blue-400', 'bg-yellow-100'); const timeout = setTimeout(() => { row.classList.remove('ring-2', 'ring-blue-400', 'bg-yellow-100'); onClearFocus(); }, 3000); return () => { clearTimeout(timeout); row.classList.remove('ring-2', 'ring-blue-400', 'bg-yellow-100'); }; }, [focusedStoreId, onClearFocus]); const { error: notificationError, message: notificationMessage, settings: notificationSettings, capabilities: notificationCapabilities, loading: notificationLoading, dirty: notificationDirty, saving: notificationSaving, onReset: onNotificationReset, onSave: onNotificationSave, onFieldChange: onNotificationFieldChange, onSendTest: onNotificationTest, onCopyLink: onNotificationCopy, copyFeedback, ntfyPreviewUrl } = notificationProps; return (

Foodsharing Pickup Manager

Angemeldet

{session.profile.name}

Profil-ID: {session.profile.id}

{notificationLoading && Lade…}
{notificationPanelOpen && ( )}
{!availableCollapsed && (
{stores.map((store) => { const storeId = String(store.id); const entry = configMap.get(storeId); const isVisible = entry && !entry.hidden; const blockedByNoPickups = store.hasPickupSlots === false; let statusLabel = 'Hinzufügen'; let statusClass = 'text-blue-600'; if (isVisible) { statusLabel = 'Bereits in Konfiguration'; statusClass = 'text-gray-500'; } else if (entry) { statusLabel = 'Ausgeblendet – erneut hinzufügen'; statusClass = 'text-amber-600'; } else if (blockedByNoPickups) { statusLabel = 'Keine Pickups – automatisch verborgen'; statusClass = 'text-red-600'; } return (

{store.name}

{store.zip} {store.city}

{statusLabel}

); })}
)}
{error && (
{error}
)} {status && (
{status}
)}
{visibleConfig.map((item, index) => { const normalizedRange = item.desiredDateRange ? { ...item.desiredDateRange } : item.desiredDate ? { start: item.desiredDate, end: item.desiredDate } : null; const rangeStart = normalizedRange?.start || ''; const rangeEnd = normalizedRange?.end || ''; const hasDateRange = Boolean(rangeStart || rangeEnd); return ( ); })}
Aktiv Geschäft Profil prüfen Nur benachrichtigen Wochentag Datum / Zeitraum Aktionen
onToggleActive(item.id)} className="h-5 w-5" /> {item.label} {item.hidden && (ausgeblendet)} onToggleProfileCheck(item.id)} className="h-5 w-5" /> onToggleOnlyNotify(item.id)} className="h-5 w-5" /> {canDelete && ( )}
); }; export default DashboardView;