import Layout from "@/components/Layout"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { REALM_OPTIONS, RealmKey } from "@/components/settings/RealmSwitcher"; import { useAuth } from "@/contexts/AuthContext"; import { useMemo } from "react"; import { Link } from "react-router-dom"; import { cn } from "@/lib/utils"; const realmRoute: Record = { game_developer: "/dashboard", client: "/consulting", community_member: "/community", customer: "/get-started", staff: "/staff", }; export default function Portal() { const { profile, roles } = useAuth(); const lastRealm = (profile as any)?.user_type as RealmKey | undefined; const canSeeStaff = useMemo( () => roles.some((r) => ["owner", "admin", "founder", "staff", "employee"].includes( r.toLowerCase(), ), ), [roles], ); const visible = useMemo( () => REALM_OPTIONS.filter((o) => (o.id === "staff" ? canSeeStaff : true)), [canSeeStaff], ); return (
Portal

Choose your realm

Jump into the dashboard that matches your goals. Your last selection is highlighted.

{visible.map((realm, i) => { const Icon = realm.icon; const active = lastRealm === realm.id; return (
{realm.title} {realm.name}

{realm.description}

{realm.highlights.slice(0, 3).map((h) => ( {h} ))}
{active && (
)} ); })}
); }