Files
CRAPP/src/components/crapp/SerieCard.tsx
T
davideandClaude Sonnet 5.5 77e5daaa7a Caratteri più grandi in tutta l'app (DD-049); etichetta «Cacche» nella rosa
Ogni testo sotto i 16 px sale di un passo in tutte le pagine (12→13, 13→14,
14→15, 15→16); restano invariate le barre a pillola dei menu (navigazione in
basso e sottosezioni) e i badge da 10-11 px. Nella scheda giocatore di Squadra
l'etichetta «Cacche/partita» diventa «Cacche» (il valore resta la media).
Documentazione: DD-049, CHANGELOG, ARCHITECTURE, PROJECT_STATE, moduli squadra
e allenatore.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 11:50:28 +02:00

83 lines
3.1 KiB
TypeScript

import { Flame } from "lucide-react";
import { cn } from "@/lib/utils";
import { Card } from "@/components/crapp/ui-bits";
import type { Giocatore } from "@/lib/crapp-data";
import { serieGiocatore, serieMigliore } from "@/lib/serie";
import { Barra } from "@/components/motion/Barra";
import { Reveal } from "@/components/motion/Reveal";
/** Griglia completa delle serie di presenza (profilo). */
export function SerieGriglia({ g }: { g: Giocatore }) {
const serie = serieGiocatore(g);
return (
<div className="space-y-2">
{serie.map((s, i) => {
const Icon = s.def.icon;
const attiva = s.valore > 0;
return (
<Reveal key={s.def.tipo} indice={i} className="premi rounded-3xl bg-card p-4 shadow-card">
<div className="flex items-center gap-3">
<span
className={cn(
"grid h-10 w-10 shrink-0 place-items-center rounded-2xl",
attiva
? "bg-accent-grad text-accent-foreground"
: "bg-secondary text-muted-foreground",
)}
>
<Icon className="h-5 w-5" />
</span>
<div className="min-w-0 flex-1">
<p className="text-[15px] font-bold leading-tight">{s.def.label}</p>
<p className="text-[13px] text-muted-foreground">{s.def.descrizione}</p>
</div>
<span className="inline-flex items-center gap-1 font-display text-2xl leading-none">
<Flame
className={cn("h-4 w-4", attiva ? "text-accent" : "text-muted-foreground/40")}
/>
{s.valore}
</span>
</div>
<Barra percentuale={s.progresso} trackClassName="mt-3" />
<p className="mt-2 text-[13px] text-muted-foreground">
{s.prossimo ? `${s.valore}/${s.prossimo} · ` : ""}
{s.messaggio}
</p>
</Reveal>
);
})}
</div>
);
}
/** Riepilogo compatto per la home. */
export function SerieHome({ g }: { g: Giocatore }) {
const top = serieMigliore(g);
const Icon = top.def.icon;
return (
<Card>
<div className="flex items-center gap-3">
<span className="grid h-10 w-10 shrink-0 place-items-center rounded-2xl bg-accent-grad text-accent-foreground">
<Icon className="h-5 w-5" />
</span>
<div className="min-w-0 flex-1">
<p className="text-[15px] font-bold leading-tight">
Serie {top.def.label.toLowerCase()}: {top.valore}
</p>
<p className="text-[13px] text-muted-foreground">{top.messaggio}</p>
</div>
</div>
<div className="mt-3 grid grid-cols-3 gap-2">
{serieGiocatore(g).map((s) => (
<div key={s.def.tipo} className="rounded-2xl bg-secondary p-2 text-center">
<p className="font-display text-xl leading-none">{s.valore}</p>
<p className="mt-1 text-[13px] font-semibold uppercase text-muted-foreground">
{s.def.label}
</p>
</div>
))}
</div>
</Card>
);
}