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, Trash2 } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useState } from "react";
|
||||
import { addEventPrize, deleteEventPrize } from "@/actions/events";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
@@ -38,6 +39,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
const t = useTranslations("pages.admin.events");
|
||||
const { run, isPending } = useServerAction();
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [form, setForm] = useState<EventPrizeInput>({
|
||||
@@ -70,9 +72,9 @@ export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>Prizes</CardTitle>
|
||||
<CardTitle>{t("statPrizes")}</CardTitle>
|
||||
<Button size="sm" onClick={() => setShowForm(!showForm)}>
|
||||
<Plus className="h-4 w-4 mr-1" /> Add Prize
|
||||
<Plus className="h-4 w-4 mr-1" /> {t("addPrize")}
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
@@ -159,9 +161,7 @@ export function EventPrizesManager({ eventId, prizes }: Props) {
|
||||
)}
|
||||
|
||||
{prizes.length === 0 && !showForm && (
|
||||
<p className="text-sm text-muted-foreground text-center py-4">
|
||||
No prizes configured yet.
|
||||
</p>
|
||||
<div className="admin-empty">{t("noPrizes")}</div>
|
||||
)}
|
||||
|
||||
{prizes.map((prize) => (
|
||||
|
||||
Reference in new issue
Block a user