Admin → Statisztika shows sign-ups, own charts, purchases, analyses, the weekly horoscope's readers, forum posts and the AI cost for 7, 30 or 90 days (or since the start), day by day, the way from sign-up to payment, and the members' sources, devices and sign-up methods. At sign-up the site now records where the member came from (Facebook, a search engine, another site's address, the link's campaign tags) and the device type: the page keeps what it saw when the visit began in memory only and sends it with the sign-up; nothing is stored in the browser or about visitors who do not sign up. The privacy notice and the data export include it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import Link from "next/link";
|
|
|
|
import type { Role } from "@/lib/types";
|
|
|
|
import { FeedbackCount } from "./FeedbackCount";
|
|
|
|
const PAGES = [
|
|
{ href: "/admin/statisztika", label: "Statisztika" },
|
|
{ href: "/admin", label: "Felhasználók" },
|
|
{ href: "/admin/meghivok", label: "Meghívók" },
|
|
{ href: "/admin/promokodok", label: "Promókódok" },
|
|
{ href: "/admin/ajandekok", label: "Ajándékok" },
|
|
{ href: "/admin/visszajelzesek", label: "Visszajelzések", count: true },
|
|
{ href: "/admin/hires-emberek", label: "Híres emberek", creator: true },
|
|
{ href: "/admin/promptok", label: "Promptok" },
|
|
{ href: "/admin/modellek", label: "Modellek" },
|
|
{ href: "/admin/hibak", label: "Hibanapló" },
|
|
];
|
|
|
|
/** May manage the famous people (an admin or a creator). */
|
|
export function canEditCelebrities(roles: Role[]): boolean {
|
|
return roles.includes("admin") || roles.includes("creator");
|
|
}
|
|
|
|
/** Switches between the admin pages (a creator who is no admin: only theirs). */
|
|
export function AdminNav({ current, roles }: { current: string; roles?: Role[] }) {
|
|
const admin = !roles || roles.includes("admin");
|
|
return (
|
|
<nav className="admin-nav" aria-label="Admin oldalak">
|
|
{PAGES.filter((p) => admin || ("creator" in p && p.creator)).map((p) => (
|
|
<Link key={p.href} href={p.href} aria-current={p.href === current ? "page" : undefined}>
|
|
{p.label}
|
|
{"count" in p && p.count && <FeedbackCount />}
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
);
|
|
}
|