Initial commit: dashboard

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-03 23:17:36 +03:30
co-authored by Cursor
commit 3db32212ad
177 changed files with 29988 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
"use client";
import { useAuth } from "@/components/AuthProvider";
import { en } from "@/lib/i18n/en";
import { getAdminDashboardOrigin } from "@/lib/host";
import { openBusinessDashboardAsUser } from "@/lib/session-handoff";
import { getDisplayName, getFirstName } from "@/lib/userName";
import styles from "./CustomerHome.module.css";
export default function CustomerHome() {
const { user, isBusinessOwner, isSuperAdmin } = useAuth();
const firstName = getFirstName(user);
return (
<div className={styles.page}>
<header className={styles.head}>
<div>
<h1 className={styles.title}>
{en.customerHome.title}, {firstName}
</h1>
<p className={styles.lead}>{en.customerHome.lead}</p>
</div>
</header>
<section className={styles.card}>
<h2 className={styles.cardTitle}>{getDisplayName(user)}</h2>
<p className={styles.cardCopy}>{en.customerHome.lead}</p>
</section>
{isSuperAdmin ? (
<section className={styles.card}>
<h2 className={styles.cardTitle}>{en.openAdminDashboard}</h2>
<p className={styles.cardCopy}>{en.customerHome.adminLead}</p>
<a
href={`${getAdminDashboardOrigin()}/`}
className={styles.cta}
>
{en.customerHome.adminCta}
</a>
</section>
) : null}
{isBusinessOwner ? (
<section className={styles.card}>
<h2 className={styles.cardTitle}>{en.openBusinessDashboard}</h2>
<p className={styles.cardCopy}>{en.customerHome.businessLead}</p>
<button
type="button"
className={styles.cta}
onClick={() => openBusinessDashboardAsUser("/profile")}
>
{en.customerHome.businessCta}
</button>
</section>
) : null}
</div>
);
}