"use client"; import { Users, MonitorSmartphone, ShieldAlert, Activity } from "lucide-react"; import { useLanguage } from "@/components/language-provider"; import { Section, SectionHeading } from "@/components/ui/section"; const STATS = [ { key: "users", value: "128,492", icon: "users" }, { key: "sessions", value: "3,914", icon: "sessions" }, { key: "events", value: "742", icon: "events" }, { key: "activeNow", value: "1,208", icon: "activeNow" }, ] as const; const ICONS = { users: Users, sessions: MonitorSmartphone, events: ShieldAlert, activeNow: Activity, }; const SESSION_ROWS = [ { user: "leila@bermooda.io", app: "Bermooda", loc: "Tehran, IR", status: "active" }, { user: "sam@hamsoo.com", app: "Hamsoo", loc: "Istanbul, TR", status: "active" }, { user: "ops@acme.com", app: "Bermooda", loc: "Berlin, DE", status: "idle" }, { user: "dev@acme.com", app: "Hamsoo", loc: "Dubai, AE", status: "active" }, ]; const EVENT_ROWS = [ { kind: "login_success", who: "leila@bermooda.io", when: "2m" }, { kind: "token_refreshed", who: "sam@hamsoo.com", when: "6m" }, { kind: "login_failed", who: "unknown@acme.com", when: "14m" }, { kind: "session_revoked", who: "ops@acme.com", when: "22m" }, ]; export function Dashboard() { const { t, lang } = useLanguage(); return (
{STATS.map((s) => { const Icon = ICONS[s.icon]; return (
{s.value}
{t.dashboard[s.key]}
); })}

{t.dashboard.sessions}

{SESSION_ROWS.map((r, i) => (
{r.user.charAt(0).toUpperCase()}
{r.user}
{r.app} · {r.loc}
{r.status === "active" ? lang === "fa" ? "فعال" : "Active" : lang === "fa" ? "غیرفعال" : "Idle"}
))}

{t.dashboard.events}

{EVENT_ROWS.map((r, i) => (
{r.kind} {r.who} {r.when}
))}
); }