'use client'
import React from 'react'
import {
CourseCategory,
EnrollmentStatus,
COURSE_CATEGORY_INFO,
ENROLLMENT_STATUS_INFO
} from '@/lib/sdk/academy/types'
import { Tab, TabId } from '../_types'
// =============================================================================
// TAB NAVIGATION
// =============================================================================
export function TabNavigation({
tabs,
activeTab,
onTabChange
}: {
tabs: Tab[]
activeTab: TabId
onTabChange: (tab: TabId) => void
}) {
return (
)
}
// =============================================================================
// STAT CARD
// =============================================================================
export function StatCard({
label,
value,
color = 'gray',
icon,
trend
}: {
label: string
value: number | string
color?: 'gray' | 'blue' | 'yellow' | 'red' | 'green' | 'purple'
icon?: React.ReactNode
trend?: { value: number; label: string }
}) {
const colorClasses = {
gray: 'border-gray-200 text-gray-900',
blue: 'border-blue-200 text-blue-600',
yellow: 'border-yellow-200 text-yellow-600',
red: 'border-red-200 text-red-600',
green: 'border-green-200 text-green-600',
purple: 'border-purple-200 text-purple-600'
}
return (
{label}
{value}
{trend && (
= 0 ? 'text-green-600' : 'text-red-600'}`}>
{trend.value >= 0 ? '+' : ''}{trend.value} {trend.label}
)}
{icon && (
{icon}
)}
)
}
// =============================================================================
// FILTER BAR
// =============================================================================
export function FilterBar({
selectedCategory,
selectedStatus,
onCategoryChange,
onStatusChange,
onClear
}: {
selectedCategory: CourseCategory | 'all'
selectedStatus: EnrollmentStatus | 'all'
onCategoryChange: (category: CourseCategory | 'all') => void
onStatusChange: (status: EnrollmentStatus | 'all') => void
onClear: () => void
}) {
const hasFilters = selectedCategory !== 'all' || selectedStatus !== 'all'
return (
Filter:
{/* Category Filter */}
{/* Enrollment Status Filter */}
{/* Clear Filters */}
{hasFilters && (
)}
)
}