Skip to content

Commit cb0ce8d

Browse files
committed
.
1 parent 1a3620c commit cb0ce8d

File tree

1 file changed

+82
-82
lines changed

1 file changed

+82
-82
lines changed

app/admin/userinfo/page.tsx

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -267,88 +267,6 @@ export default function UserInfoPage() {
267267
</div>
268268
)}
269269

270-
{/* ATC-Statistiken – zeigt Skeleton bis Daten geladen */}
271-
{(statsLoading || (stats !== null && urlCid)) && (
272-
<div className="space-y-6">
273-
{/* Top 5 Stationen */}
274-
<Card>
275-
<CardHeader>
276-
<CardTitle className="flex items-center gap-2">
277-
<BarChart2 className="w-4 h-4" />
278-
Top 5 Stationen
279-
{!statsLoading && stats && (
280-
<Badge variant="secondary">{stats.length} gesamt</Badge>
281-
)}
282-
</CardTitle>
283-
<CardDescription>
284-
Stationen mit den meisten kontrollierten Stunden – klicken zum Aufklappen
285-
</CardDescription>
286-
</CardHeader>
287-
<CardContent>
288-
{statsLoading ? (
289-
<div className="space-y-2">
290-
{Array.from({ length: 5 }).map((_, i) => (
291-
<Skeleton key={i} className="h-10 w-full" />
292-
))}
293-
</div>
294-
) : top5.length === 0 ? (
295-
<p className="text-muted-foreground text-center py-4">
296-
Keine ATC-Statistiken vorhanden
297-
</p>
298-
) : (
299-
<div className="space-y-2">
300-
{top5.map((s, idx) => (
301-
<StationRow key={s.station} s={s} rank={idx + 1} />
302-
))}
303-
</div>
304-
)}
305-
</CardContent>
306-
</Card>
307-
308-
{/* Stations-Suche */}
309-
<Card>
310-
<CardHeader>
311-
<CardTitle className="flex items-center gap-2">
312-
<Search className="w-4 h-4" />
313-
Stationssuche
314-
</CardTitle>
315-
<CardDescription>
316-
Nach Airport oder Position suchen (z.B. &quot;EDDM&quot; oder &quot;TWR&quot;) – klicken zum Aufklappen
317-
</CardDescription>
318-
</CardHeader>
319-
<CardContent className="space-y-4">
320-
<Input
321-
placeholder="Station suchen..."
322-
value={stationSearch}
323-
onChange={(e) => setStationSearch(e.target.value)}
324-
disabled={statsLoading}
325-
/>
326-
{stationSearch.trim() && (
327-
<>
328-
{statsLoading ? (
329-
<div className="space-y-2">
330-
{Array.from({ length: 3 }).map((_, i) => (
331-
<Skeleton key={i} className="h-10 w-full" />
332-
))}
333-
</div>
334-
) : searchResults.length === 0 ? (
335-
<p className="text-muted-foreground text-center py-4">
336-
Keine Stationen für &quot;{stationSearch}&quot; gefunden
337-
</p>
338-
) : (
339-
<div className="space-y-2">
340-
{searchResults.map((s) => (
341-
<StationRow key={s.station} s={s} />
342-
))}
343-
</div>
344-
)}
345-
</>
346-
)}
347-
</CardContent>
348-
</Card>
349-
</div>
350-
)}
351-
352270
{isDataVisible && (
353271
<div className="space-y-6">
354272
{/* Endorsements */}
@@ -529,6 +447,88 @@ export default function UserInfoPage() {
529447
</div>
530448
)}
531449

450+
{/* ATC-Statistiken – zeigt Skeleton bis Daten geladen */}
451+
{(statsLoading || (stats !== null && urlCid)) && (
452+
<div className="space-y-6">
453+
{/* Stations-Suche */}
454+
<Card>
455+
<CardHeader>
456+
<CardTitle className="flex items-center gap-2">
457+
<Search className="w-4 h-4" />
458+
Stationssuche
459+
</CardTitle>
460+
<CardDescription>
461+
Nach Airport oder Position suchen (z.B. &quot;EDDM&quot; oder &quot;TWR&quot;) – klicken zum Aufklappen
462+
</CardDescription>
463+
</CardHeader>
464+
<CardContent className="space-y-4">
465+
<Input
466+
placeholder="Station suchen..."
467+
value={stationSearch}
468+
onChange={(e) => setStationSearch(e.target.value)}
469+
disabled={statsLoading}
470+
/>
471+
{stationSearch.trim() && (
472+
<>
473+
{statsLoading ? (
474+
<div className="space-y-2">
475+
{Array.from({ length: 3 }).map((_, i) => (
476+
<Skeleton key={i} className="h-10 w-full" />
477+
))}
478+
</div>
479+
) : searchResults.length === 0 ? (
480+
<p className="text-muted-foreground text-center py-4">
481+
Keine Stationen für &quot;{stationSearch}&quot; gefunden
482+
</p>
483+
) : (
484+
<div className="space-y-2">
485+
{searchResults.map((s) => (
486+
<StationRow key={s.station} s={s} />
487+
))}
488+
</div>
489+
)}
490+
</>
491+
)}
492+
</CardContent>
493+
</Card>
494+
495+
{/* Top 5 Stationen */}
496+
<Card>
497+
<CardHeader>
498+
<CardTitle className="flex items-center gap-2">
499+
<BarChart2 className="w-4 h-4" />
500+
Top 5 Stationen
501+
{!statsLoading && stats && (
502+
<Badge variant="secondary">{stats.length} gesamt</Badge>
503+
)}
504+
</CardTitle>
505+
<CardDescription>
506+
Stationen mit den meisten kontrollierten Stunden – klicken zum Aufklappen
507+
</CardDescription>
508+
</CardHeader>
509+
<CardContent>
510+
{statsLoading ? (
511+
<div className="space-y-2">
512+
{Array.from({ length: 5 }).map((_, i) => (
513+
<Skeleton key={i} className="h-10 w-full" />
514+
))}
515+
</div>
516+
) : top5.length === 0 ? (
517+
<p className="text-muted-foreground text-center py-4">
518+
Keine ATC-Statistiken vorhanden
519+
</p>
520+
) : (
521+
<div className="space-y-2">
522+
{top5.map((s, idx) => (
523+
<StationRow key={s.station} s={s} rank={idx + 1} />
524+
))}
525+
</div>
526+
)}
527+
</CardContent>
528+
</Card>
529+
</div>
530+
)}
531+
532532
{!data && !loading && !error && urlCid && (
533533
<Card>
534534
<CardContent className="text-center py-8">

0 commit comments

Comments
 (0)