minor changes

This commit is contained in:
2025-11-10 21:52:20 +01:00
parent 727af7e26d
commit f4a79a6bc4
2 changed files with 35 additions and 49 deletions

View File

@@ -740,6 +740,7 @@ function App() {
notificationPanelOpen={notificationPanelOpen} notificationPanelOpen={notificationPanelOpen}
onToggleNotificationPanel={() => setNotificationPanelOpen((prev) => !prev)} onToggleNotificationPanel={() => setNotificationPanelOpen((prev) => !prev)}
notificationProps={sharedNotificationProps} notificationProps={sharedNotificationProps}
isAdmin={Boolean(session?.isAdmin)}
/> />
} }
/> />

View File

@@ -98,7 +98,8 @@ const StoreWatchPage = ({
locationError = '', locationError = '',
notificationPanelOpen = false, notificationPanelOpen = false,
onToggleNotificationPanel = () => {}, onToggleNotificationPanel = () => {},
notificationProps notificationProps,
isAdmin = false
}) => { }) => {
const [regions, setRegions] = useState([]); const [regions, setRegions] = useState([]);
const [selectedRegionId, setSelectedRegionId] = useState(() => { const [selectedRegionId, setSelectedRegionId] = useState(() => {
@@ -901,24 +902,6 @@ const StoreWatchPage = ({
/> />
)} )}
{userLocation && !notificationPanelOpen && (
<div className="mb-4 rounded-lg border border-blue-100 bg-blue-50 p-4 text-sm text-blue-900">
<p>
Standort gespeichert:{' '}
{userLocation.label ? (
<span className="font-semibold">{userLocation.label}</span>
) : (
'Koordinaten'
)}{' '}
{formatCoordinate(userLocation.lat)}, {formatCoordinate(userLocation.lon)}
</p>
<p className="text-xs text-blue-800 mt-1">
Aktualisiert:{' '}
{userLocation.updatedAt ? new Date(userLocation.updatedAt).toLocaleString('de-DE') : 'Zeit unbekannt'}
</p>
</div>
)}
{(error || status) && ( {(error || status) && (
<div className="mb-4 space-y-2"> <div className="mb-4 space-y-2">
{error && ( {error && (
@@ -975,36 +958,38 @@ const StoreWatchPage = ({
))} ))}
</select> </select>
</div> </div>
<div className="flex flex-wrap gap-2"> {isAdmin && (
<button <div className="flex flex-wrap gap-2">
type="button" <button
onClick={() => loadRegions()} type="button"
className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100" onClick={() => loadRegions()}
disabled={regionLoading} className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100"
> disabled={regionLoading}
Regionen neu laden >
</button> Regionen neu laden
<button </button>
type="button" <button
onClick={() => type="button"
selectedRegionId === 'all' onClick={() =>
? fetchAllRegions({ force: true }) selectedRegionId === 'all'
: fetchStoresForRegion(selectedRegionId, { force: true }) ? fetchAllRegions({ force: true })
} : fetchStoresForRegion(selectedRegionId, { force: true })
className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100" }
disabled={regionLoading || storesLoading || (selectedRegionId === 'all' && regions.length === 0)} className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100"
> disabled={regionLoading || storesLoading || (selectedRegionId === 'all' && regions.length === 0)}
Betriebe aktualisieren >
</button> Betriebe aktualisieren
<button </button>
type="button" <button
onClick={handleStatusRefresh} type="button"
className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100" onClick={handleStatusRefresh}
disabled={regionLoading || (selectedRegionId === 'all' && regions.length === 0)} className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100"
> disabled={regionLoading || (selectedRegionId === 'all' && regions.length === 0)}
Team-Status aktualisieren >
</button> Team-Status aktualisieren
</div> </button>
</div>
)}
</div> </div>
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mt-2 text-xs text-gray-500"> <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mt-2 text-xs text-gray-500">
<span>Es werden nur Regionen angezeigt, in denen du Mitglied mit Klassifikation 1 bist.</span> <span>Es werden nur Regionen angezeigt, in denen du Mitglied mit Klassifikation 1 bist.</span>