import { useEffect, useState } from "react"; import { Link, NavLink } from "react-router-dom"; import { useAuth } from "../context/AuthContext"; import { useDocumentTitle } from "../hooks/useDocumentTitle"; import { fetchCreatorDashboard, exportCreatorData, type CreatorDashboardResponse, } from "../api/creator-dashboard"; import { ApiError } from "../api/client"; import styles from "./CreatorDashboard.module.css"; function SidebarNav() { const linkClass = ({ isActive }: { isActive: boolean }) => `${styles.sidebarLink}${isActive ? ` ${styles.sidebarLinkActive}` : ""}`; return ( ); } export { SidebarNav }; /* ── Stat card ─────────────────────────────────────────────────────────────── */ function StatCard({ value, label }: { value: number; label: string }) { return (
Your account isn't linked to a creator profile yet. Contact an admin to get set up.
Could not load dashboard: {error}
No technique pages yet.
) : ( <> {/* Desktop table */}| Title | Category | Moments | Created |
|---|---|---|---|
| {t.title} | {t.topic_category} | {t.key_moment_count} | {formatDate(t.created_at)} |
No videos uploaded yet.
) : ( <>| Filename | Status | Uploaded |
|---|---|---|
| {v.filename} | {v.processing_status} | {formatDate(v.created_at)} |