import { useEffect, useState } from "react" import { Link, useParams } from "react-router-dom" import { BookOpen, Mic, Briefcase, HelpCircle, ArrowLeft, ArrowRight, ChevronRight } from "lucide-react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card" import { Button } from "../../components/ui/button" import { getCourseCategories } from "../../api/courses.api" import type { CourseCategory } from "../../types/course.types" const contentSections = [ { key: "courses", pathFn: (categoryId: string | undefined) => `/content/category/${categoryId}/courses`, icon: BookOpen, title: "Courses", description: "Manage course videos and educational content", action: "Manage Courses", count: 12, countLabel: "courses", gradient: "from-brand-500/10 via-brand-400/5 to-transparent", accentBorder: "group-hover:border-brand-400", }, { key: "speaking", pathFn: () => "/content/speaking", icon: Mic, title: "Speaking", description: "Manage speaking practice sessions and exercises", action: "Manage Speaking", count: 8, countLabel: "sessions", gradient: "from-purple-500/10 via-purple-400/5 to-transparent", accentBorder: "group-hover:border-purple-400", }, { key: "practices", pathFn: () => "/content/practices", icon: Briefcase, title: "Practice", description: "Manage practice details, members, and leadership", action: "Manage Practice", count: 5, countLabel: "practices", gradient: "from-indigo-500/10 via-indigo-400/5 to-transparent", accentBorder: "group-hover:border-indigo-400", }, { key: "questions", pathFn: () => "/content/questions", icon: HelpCircle, title: "Questions", description: "Manage questions, quizzes, and assessments", action: "Manage Questions", count: 34, countLabel: "questions", gradient: "from-rose-500/10 via-rose-400/5 to-transparent", accentBorder: "group-hover:border-rose-400", }, ] as const export function ContentOverviewPage() { const { categoryId } = useParams<{ categoryId: string }>() const [category, setCategory] = useState(null) useEffect(() => { const fetchCategory = async () => { try { const res = await getCourseCategories() const found = res.data.data.categories.find((c) => c.id === Number(categoryId)) setCategory(found ?? null) } catch (err) { console.error("Failed to fetch category:", err) } } if (categoryId) { fetchCategory() } }, [categoryId]) return (
{/* Header & Breadcrumb */}
Content {category?.name ?? "Overview"}

{category?.name ?? "Content Management"}

{/* Gradient Divider */}