minor changes
This commit is contained in:
@@ -98,7 +98,8 @@ const StoreWatchPage = ({
|
||||
locationError = '',
|
||||
notificationPanelOpen = false,
|
||||
onToggleNotificationPanel = () => {},
|
||||
notificationProps
|
||||
notificationProps,
|
||||
isAdmin = false
|
||||
}) => {
|
||||
const [regions, setRegions] = 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) && (
|
||||
<div className="mb-4 space-y-2">
|
||||
{error && (
|
||||
@@ -975,36 +958,38 @@ const StoreWatchPage = ({
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => loadRegions()}
|
||||
className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100"
|
||||
disabled={regionLoading}
|
||||
>
|
||||
Regionen neu laden
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
selectedRegionId === 'all'
|
||||
? 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)}
|
||||
>
|
||||
Betriebe aktualisieren
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleStatusRefresh}
|
||||
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>
|
||||
</div>
|
||||
{isAdmin && (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => loadRegions()}
|
||||
className="px-4 py-2 border rounded-md text-sm bg-white hover:bg-gray-100"
|
||||
disabled={regionLoading}
|
||||
>
|
||||
Regionen neu laden
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() =>
|
||||
selectedRegionId === 'all'
|
||||
? 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)}
|
||||
>
|
||||
Betriebe aktualisieren
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleStatusRefresh}
|
||||
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>
|
||||
</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">
|
||||
<span>Es werden nur Regionen angezeigt, in denen du Mitglied mit Klassifikation 1 bist.</span>
|
||||
|
||||
Reference in New Issue
Block a user