'use client'
import { Users, GraduationCap, BookOpen, FileCheck } from 'lucide-react'
import { CompanionStats } from '@/lib/companion/types'
interface StatsGridProps {
stats: CompanionStats
loading?: boolean
}
interface StatCardProps {
label: string
value: number
icon: React.ReactNode
color: string
loading?: boolean
}
function StatCard({ label, value, icon, color, loading }: StatCardProps) {
return (
{label}
{loading ? (
) : (
{value}
)}
{icon}
)
}
export function StatsGrid({ stats, loading }: StatsGridProps) {
const statCards = [
{
label: 'Klassen',
value: stats.classesCount,
icon: ,
color: 'bg-blue-100',
},
{
label: 'Schueler',
value: stats.studentsCount,
icon: ,
color: 'bg-green-100',
},
{
label: 'Lerneinheiten',
value: stats.learningUnitsCreated,
icon: ,
color: 'bg-purple-100',
},
{
label: 'Noten',
value: stats.gradesEntered,
icon: ,
color: 'bg-amber-100',
},
]
return (
{statCards.map((card) => (
))}
)
}
/**
* Compact version of StatsGrid for sidebar or smaller spaces
*/
export function StatsGridCompact({ stats, loading }: StatsGridProps) {
const items = [
{ label: 'Klassen', value: stats.classesCount, icon: },
{ label: 'Schueler', value: stats.studentsCount, icon: },
{ label: 'Einheiten', value: stats.learningUnitsCreated, icon: },
{ label: 'Noten', value: stats.gradesEntered, icon: },
]
return (
Statistiken
{items.map((item) => (
{item.icon}
{item.label}
{loading ? (
) : (
{item.value}
)}
))}
)
}