Dashboard: dynamische Locked-in-Überschrift im Team-Bereich
Statt fester "Heute im Team"-Überschrift jetzt zählerabhängiger Satz: 0 / 1 Person / mehrere Personen. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c8fc024ca0
commit
804b7637e7
1 file changed
+8
-9
@@ -215,23 +215,22 @@ function TeamHeuteSection() {
|
||||
if (team.isPending) return null;
|
||||
const data = team.data ?? [];
|
||||
const userMap = new Map((users.data ?? []).map((u) => [u.id, u.name]));
|
||||
const lockedInLabel =
|
||||
data.length === 0
|
||||
? 'Heute ist noch niemand locked in.'
|
||||
: data.length === 1
|
||||
? 'Heute ist 1 Person locked in.'
|
||||
: `Heute sind ${data.length} Personen locked in.`;
|
||||
if (data.length === 0) {
|
||||
return (
|
||||
<section>
|
||||
<h2 className="mb-3 text-lg font-semibold">Heute im Team</h2>
|
||||
<Card.Root>
|
||||
<Card.Body>
|
||||
<p className="text-sm text-[var(--color-ink-muted)]">
|
||||
Heute hat sich noch niemand locked in.
|
||||
</p>
|
||||
</Card.Body>
|
||||
</Card.Root>
|
||||
<h2 className="mb-3 text-lg font-semibold">{lockedInLabel}</h2>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<section>
|
||||
<h2 className="mb-3 text-lg font-semibold">Heute im Team</h2>
|
||||
<h2 className="mb-3 text-lg font-semibold">{lockedInLabel}</h2>
|
||||
<div className="grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3">
|
||||
{data.map((u) => (
|
||||
<Card.Root key={u.userId}>
|
||||
|
||||
Reference in new issue
Block a user