i18n events/polls detail pages, forms, and empty sections.
Align detail headers with admin chrome, translate stats/forms/breadcrumbs, and use admin-empty for prizes, winners, registrations, and questions. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
dd9c5e70c2
commit
a25008deb5
12 files changed
+325
-91
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Plus } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useState } from "react";
|
||||
import { addEventWinner } from "@/actions/events";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -23,6 +24,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export function EventWinnersManager({ eventId, winners }: Props) {
|
||||
const t = useTranslations("pages.admin.events");
|
||||
const { run, isPending } = useServerAction();
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [userId, setUserId] = useState("");
|
||||
@@ -43,9 +45,9 @@ export function EventWinnersManager({ eventId, winners }: Props) {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>Winners</CardTitle>
|
||||
<CardTitle>{t("statWinners")}</CardTitle>
|
||||
<Button size="sm" onClick={() => setShowForm(!showForm)}>
|
||||
<Plus className="h-4 w-4 mr-1" /> Add Winner
|
||||
<Plus className="h-4 w-4 mr-1" /> {t("addWinner")}
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
@@ -80,9 +82,7 @@ export function EventWinnersManager({ eventId, winners }: Props) {
|
||||
)}
|
||||
|
||||
{winners.length === 0 && !showForm && (
|
||||
<p className="text-sm text-muted-foreground text-center py-4">
|
||||
No winners yet.
|
||||
</p>
|
||||
<div className="admin-empty">{t("noWinners")}</div>
|
||||
)}
|
||||
|
||||
<div className="divide-y">
|
||||
|
||||
Reference in new issue
Block a user