This commit is contained in:
2026-05-03 17:01:46 +03:30
parent b5ad5420b2
commit 9c30295b4b
76 changed files with 7891 additions and 461 deletions

View File

@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
import Image from "next/image";
type Country = { id: string; name: string };
type CardTier = "GOLD" | "SILVER" | "BRONZE";
export default function PlayerForm({
countries,
@@ -12,7 +13,7 @@ export default function PlayerForm({
playerId,
}: {
countries: Country[];
initial?: { name: string; position: string; countryId: string; price: number; image?: string | null };
initial?: { name: string; position: string; countryId: string; price: number; image?: string | null; cardTier: CardTier };
playerId?: string;
}) {
const router = useRouter();
@@ -22,6 +23,7 @@ export default function PlayerForm({
countryId: initial?.countryId ?? "",
price: initial?.price ?? 5.0,
image: initial?.image ?? "",
cardTier: initial?.cardTier ?? "BRONZE",
});
const [loading, setLoading] = useState(false);
const [uploading, setUploading] = useState(false);
@@ -154,6 +156,18 @@ export default function PlayerForm({
className="w-full border rounded-xl px-4 py-2.5 focus:outline-none focus:ring-2 focus:ring-green-500"
/>
</div>
<div>
<label className="block text-sm font-medium mb-1">نوع کارت</label>
<select
value={form.cardTier}
onChange={(e) => setForm({ ...form, cardTier: e.target.value as CardTier })}
className="w-full border rounded-xl px-4 py-2.5 focus:outline-none focus:ring-2 focus:ring-green-500"
>
<option value="GOLD">طلایی</option>
<option value="SILVER">نقره ای</option>
<option value="BRONZE">برنزی</option>
</select>
</div>
<button
type="submit"
disabled={loading}