diff --git a/src/components/crapp/ui-bits.tsx b/src/components/crapp/ui-bits.tsx
index 6532173..af66458 100644
--- a/src/components/crapp/ui-bits.tsx
+++ b/src/components/crapp/ui-bits.tsx
@@ -1,4 +1,5 @@
-import type { ReactNode } from "react";
+import { useState, type ReactNode } from "react";
+import { ChevronDown } from "lucide-react";
import { cn } from "@/lib/utils";
import { statoMeta, type Stato } from "@/lib/crapp-data";
import { Reveal } from "@/components/motion/Reveal";
@@ -52,6 +53,43 @@ export function Section({
);
}
+/** Sezione con titolo cliccabile: il contenuto si apre e chiude. `anteprima` resta sempre visibile. */
+export function SezioneTendina({
+ titolo,
+ children,
+ anteprima,
+ defaultAperta = false,
+ indice = 0,
+}: {
+ titolo: string;
+ children: ReactNode;
+ anteprima?: ReactNode;
+ defaultAperta?: boolean;
+ indice?: number;
+}) {
+ const [aperta, setAperta] = useState(defaultAperta);
+ return (
+
+
+ {anteprima}
+ {aperta ? children : null}
+
+ );
+}
+
export function StatoBadge({ stato, className }: { stato: Stato; className?: string }) {
const meta = statoMeta[stato];
return (
diff --git a/src/routes/calendario.tsx b/src/routes/calendario.tsx
index ed01735..623cd4d 100644
--- a/src/routes/calendario.tsx
+++ b/src/routes/calendario.tsx
@@ -128,6 +128,14 @@ function Calendario() {
? (eventiPerGiorno.get(giornoSelezionato) ?? [])
: [];
+ // Prossimi 4 eventi da oggi in avanti (indipendenti dal mese selezionato nella griglia).
+ const oggiIso = oggi
+ ? `${oggi.anno}-${pad2(oggi.mese + 1)}-${pad2(oggi.giorno)}`
+ : null;
+ const prossimiEventi = oggiIso
+ ? eventi.filter((e) => e.data >= oggiIso).slice(0, 4)
+ : [];
+
return (
<>
@@ -267,14 +275,14 @@ function Calendario() {
- {eventiMese.length > 0 ? (
- eventiMese.map((e) => {
+ {prossimiEventi.length > 0 ? (
+ prossimiEventi.map((e) => {
const link = linkPerEvento(e);
return
;
})
) : (
- Nessun evento in {mesiIT[mese]!.toLowerCase()}
+ Nessun evento in programma
)}
diff --git a/src/routes/classifica.tsx b/src/routes/classifica.tsx
index 0952f05..7733784 100644
--- a/src/routes/classifica.tsx
+++ b/src/routes/classifica.tsx
@@ -2,7 +2,7 @@ import { createFileRoute, Link } from "@tanstack/react-router";
import { ChevronRight, RefreshCw } from "lucide-react";
import { cn } from "@/lib/utils";
import { formatData } from "@/lib/crapp-data";
-import { PageHeader, Section } from "@/components/crapp/ui-bits";
+import { PageHeader, Section, SezioneTendina } from "@/components/crapp/ui-bits";
import { useScoutMatches } from "@/lib/scout-store";
import { useCsi } from "@/lib/csi";
import { isNostraSquadra, matchDaPartitaCsi, partiteGiocate } from "@/lib/csi-core";
@@ -123,7 +123,7 @@ function Classifica() {
-
+
{tuttiMatch.length === 0 ? (
Nessun match disponibile.
@@ -194,7 +194,7 @@ function Classifica() {
})}
)}
-
+
>
);
}
diff --git a/src/routes/squadra.tsx b/src/routes/squadra.tsx
index c29baeb..8f2f395 100644
--- a/src/routes/squadra.tsx
+++ b/src/routes/squadra.tsx
@@ -2,7 +2,7 @@ import { useState } from "react";
import { createFileRoute } from "@tanstack/react-router";
import { Cake, ChevronDown, Crown } from "lucide-react";
import { cn } from "@/lib/utils";
-import { PageHeader, Section } from "@/components/crapp/ui-bits";
+import { PageHeader, Section, SezioneTendina } from "@/components/crapp/ui-bits";
import { Avatar } from "@/components/crapp/Avatar";
import { formatData } from "@/lib/crapp-data";
import { microcopyObiettivo, progressoObiettivo } from "@/lib/obiettivi";
@@ -12,7 +12,6 @@ import { totaliSquadra, useScoutMatches } from "@/lib/scout-store";
import { useCsi } from "@/lib/csi";
import { partiteGiocate } from "@/lib/csi-core";
import { mediaSquadra, usePagelle } from "@/lib/pagelle";
-import { ScoutEntry } from "@/components/crapp/ScoutEntry";
import { StatTile } from "@/components/crapp/ui-bits";
import { Reveal } from "@/components/motion/Reveal";
import { Barra } from "@/components/motion/Barra";
@@ -232,12 +231,9 @@ function Squadra() {
-
-
-
-
+
{criteri.map((c) => (
-
+
-
-
-
-
-
- Progresso collettivo
-
-
-
+
+
+
+
+ Progresso collettivo
+
+
+
+
+
+
+ {completati}/{obiettivi.length} completati
-
- {completati}/{obiettivi.length} completati
-
+
-
-
+ }
+ >
{obiettivi.map((o, i) => {
const pct = progressoObiettivo(o);
@@ -346,9 +346,9 @@ function Squadra() {
);
})}
-
+
-
+
{badgeDefs.map((b) => {
const Icon = b.icon;
@@ -392,7 +392,7 @@ function Squadra() {
);
})}
-
+
>
);
}