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,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { GripVertical, Pencil, Plus, Trash2 } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
addPollQuestion,
|
||||
@@ -37,6 +38,7 @@ interface Props {
|
||||
type PollQuestionUpdateInput = PollQuestionInput & { id: number };
|
||||
|
||||
export function PollQuestionsManager({ pollId, questions }: Props) {
|
||||
const t = useTranslations("pages.admin.polls");
|
||||
const { run, isPending } = useServerAction();
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
const [editingId, setEditingId] = useState<number | null>(null);
|
||||
@@ -96,7 +98,9 @@ export function PollQuestionsManager({ pollId, questions }: Props) {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle>Questions ({questions.length})</CardTitle>
|
||||
<CardTitle>
|
||||
{t("questionsTitle", { count: questions.length })}
|
||||
</CardTitle>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
@@ -104,7 +108,7 @@ export function PollQuestionsManager({ pollId, questions }: Props) {
|
||||
setShowForm(!showForm);
|
||||
}}
|
||||
>
|
||||
<Plus className="h-4 w-4 mr-1" /> Add Question
|
||||
<Plus className="h-4 w-4 mr-1" /> {t("addQuestion")}
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
@@ -177,9 +181,7 @@ export function PollQuestionsManager({ pollId, questions }: Props) {
|
||||
)}
|
||||
|
||||
{questions.length === 0 && !showForm && (
|
||||
<p className="text-sm text-muted-foreground text-center py-4">
|
||||
No questions yet. Add your first question above.
|
||||
</p>
|
||||
<div className="admin-empty">{t("noQuestions")}</div>
|
||||
)}
|
||||
|
||||
<div className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user