diff --git a/messages/en.json b/messages/en.json index f23548b..3854b52 100644 --- a/messages/en.json +++ b/messages/en.json @@ -29,6 +29,7 @@ "save": "Save", "saving": "Saving…", "add": "Add", + "edit": "Edit", "delete": "Delete", "retry": "Retry", "error": "Error", diff --git a/messages/fr.json b/messages/fr.json index b1bc900..c1f2616 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -29,6 +29,7 @@ "save": "Enregistrer", "saving": "Enregistrement…", "add": "Ajouter", + "edit": "Modifier", "delete": "Supprimer", "retry": "Réessayer", "error": "Erreur", diff --git a/src/app/(app)/admin/page.tsx b/src/app/(app)/admin/page.tsx index 5efb01d..badf2f7 100644 --- a/src/app/(app)/admin/page.tsx +++ b/src/app/(app)/admin/page.tsx @@ -18,6 +18,7 @@ export default function AdminPage() { const [references, setReferences] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + const [activeTab, setActiveTab] = useState("cards"); const tabs = useMemo( () => [ @@ -108,24 +109,47 @@ export default function AdminPage() { } return ( -
-
-
-

{t("admin.title")}

-

+

+
+
+

+ {t("admin.title")} +

+

{t("admin.subtitle", { count: cards.length })}

-
- - + + + + {tabs.map((tab) => ( - + {tab.label} ))} diff --git a/src/app/(app)/page.tsx b/src/app/(app)/page.tsx index 96ea842..a180b05 100644 --- a/src/app/(app)/page.tsx +++ b/src/app/(app)/page.tsx @@ -20,12 +20,14 @@ export default async function DashboardPage() { }; return ( -
-
-

+
+
+

{t("dashboard.title")}

-

{t("dashboard.subtitle")}

+

+ {t("dashboard.subtitle")} +

-
+
+

{t("admin.cards.intro")}

-
+
+ { + setPlayerColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterPlayerTeam")} + suggestions={columnSuggestions.players} + className="h-9 text-xs" + /> + { + setTeamColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterTeam")} + suggestions={columnSuggestions.teams} + className="h-9 text-xs" + /> +
+ { + setYearColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterYear")} + suggestions={columnSuggestions.years} + className="h-9 text-xs" + /> + { + setTagsColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterTags")} + suggestions={columnSuggestions.tags} + className="h-9 text-xs" + /> +
+ { + setBrandColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterBrand")} + suggestions={columnSuggestions.brands} + className="h-9 text-xs" + /> + { + setSetColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterSet")} + suggestions={columnSuggestions.sets} + className="h-9 text-xs" + /> + { + setVariationColumnFilter(nextValue); + setPage(0); + }} + placeholder={t("admin.cards.filterVariation")} + suggestions={columnSuggestions.variations} + className="h-9 text-xs" + /> +
+ +
+ {paged.length ? ( + paged.map((card) => { + const meta = [card.team, card.year].filter(Boolean).join(" · "); + const catalog = [card.brand, card.set].filter(Boolean).join(" · "); + + return ( +
+
+
+

+ {card.player} +

+

{meta}

+
+ +
+ +
+

{catalog}

+

{card.variation}

+
+ +
+ + +
+
+ ); + }) + ) : ( +
+ {t("cards.noneFound")} +
+ )} +
+ +
@@ -567,7 +708,7 @@ export function AdminCardsSection({ {totalPages > 1 && ( -
+

{t("admin.cards.pageInfo", { page: page + 1, diff --git a/src/components/admin/admin-catalog-section.tsx b/src/components/admin/admin-catalog-section.tsx index 2035496..e413f29 100644 --- a/src/components/admin/admin-catalog-section.tsx +++ b/src/components/admin/admin-catalog-section.tsx @@ -183,6 +183,7 @@ export function AdminCatalogSection({ const [error, setError] = useState(null); const [success, setSuccess] = useState(null); const [loading, setLoading] = useState(false); + const [activeTab, setActiveTab] = useState("brands"); const setsForBrand = useMemo( () => setsLinkedToBrand(references, brandForSet), @@ -219,18 +220,34 @@ export function AdminCatalogSection({

{t("admin.catalog.intro")}

- - - {t("admin.catalog.brands")} - {t("admin.catalog.sets")} - {t("admin.catalog.variations")} + + + + + + {t("admin.catalog.brands")} + + + {t("admin.catalog.sets")} + + + {t("admin.catalog.variations")} +
-
+
diff --git a/src/components/admin/admin-players-section.tsx b/src/components/admin/admin-players-section.tsx index ac900bf..4a744fe 100644 --- a/src/components/admin/admin-players-section.tsx +++ b/src/components/admin/admin-players-section.tsx @@ -64,7 +64,7 @@ export function AdminPlayersSection({
-
+
-
diff --git a/src/components/admin/admin-years-section.tsx b/src/components/admin/admin-years-section.tsx index 531a8a5..07b9f36 100644 --- a/src/components/admin/admin-years-section.tsx +++ b/src/components/admin/admin-years-section.tsx @@ -70,7 +70,7 @@ export function AdminYearsSection({
-
+
-
diff --git a/src/components/admin/batch-text-import.tsx b/src/components/admin/batch-text-import.tsx index e89c38f..de9d019 100644 --- a/src/components/admin/batch-text-import.tsx +++ b/src/components/admin/batch-text-import.tsx @@ -68,7 +68,13 @@ export function BatchTextImport({ error={error} onSuccessDismiss={() => setSuccess(null)} /> -
diff --git a/src/components/card-table.tsx b/src/components/card-table.tsx index bf24467..d08e94e 100644 --- a/src/components/card-table.tsx +++ b/src/components/card-table.tsx @@ -337,7 +337,7 @@ export function CardTable({ cards, filters }: CardTableProps) {
{/* Mobile cards */} -
+
{table.getRowModel().rows.length ? ( table.getRowModel().rows.map((row) => { const card = row.original; @@ -354,7 +354,7 @@ export function CardTable({ cards, filters }: CardTableProps) {