Admins make promo codes for a package (Admin → Promókódok: batch, note, copy all), list them filtered (unused by default, used, revoked; by package; by code, note or redeemer) and withdraw unused ones. A logged-in user redeems a code once (header link, /bevaltas?kod=... prefilled, packages page, and the analysis and question offers point there) and gets the package as an order with source 'promo'. Failed redemptions are rate limited. Production purchases are off: MOCK_PAYMENTS now defaults to false in the deploy compose, so package cards say 'Hamarosan'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
24 lines
714 B
TypeScript
24 lines
714 B
TypeScript
import Link from "next/link";
|
|
|
|
const PAGES = [
|
|
{ href: "/admin", label: "Felhasználók" },
|
|
{ href: "/admin/meghivok", label: "Meghívók" },
|
|
{ href: "/admin/promokodok", label: "Promókódok" },
|
|
{ href: "/admin/promptok", label: "Promptok" },
|
|
{ href: "/admin/modellek", label: "Modellek" },
|
|
{ href: "/admin/hibak", label: "Hibanapló" },
|
|
];
|
|
|
|
/** Switches between the admin pages. */
|
|
export function AdminNav({ current }: { current: string }) {
|
|
return (
|
|
<nav className="admin-nav" aria-label="Admin oldalak">
|
|
{PAGES.map((p) => (
|
|
<Link key={p.href} href={p.href} aria-current={p.href === current ? "page" : undefined}>
|
|
{p.label}
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
);
|
|
}
|