'use client' import Link from 'next/link' import { ArrowLeft, AlertCircle, RefreshCw } from 'lucide-react' import type { ReactNode, Ref, UIEventHandler } from 'react' import { useTranslation } from 'react-i18next' import { LEARNING_HUB } from '@/lib/learning-routes' import { FeaturePage, PageHeader } from '@/components/layout/FeaturePage' /** The same page rhythm for the hub and each library; readers keep their full-screen layouts. */ export function LearningShell({ title, subtitle, action, scopeChip, tabs, children, back = true, className = '', scrollRef, onScroll, }: { title: ReactNode subtitle: ReactNode action?: ReactNode scopeChip?: ReactNode tabs?: ReactNode children: ReactNode back?: boolean className?: string scrollRef?: Ref onScroll?: UIEventHandler }) { const { t } = useTranslation() return ( {back && ( {t('Personalized Learning')} )} {tabs}
{children}
) } export function LearningEmptyState({ title, description, action, icon, }: { title: ReactNode description?: ReactNode action?: ReactNode icon?: ReactNode }) { return (
{icon && (
{icon}
)}

{title}

{description && (

{description}

)} {action &&
{action}
}
) } export function LearningErrorState({ message, onRetry, }: { message: ReactNode onRetry?: () => void }) { const { t } = useTranslation() return (
{message} {onRetry && ( )}
) } export function LearningSkeleton({ count = 3 }: { count?: number }) { const { t } = useTranslation() return (
{Array.from({ length: count }, (_, index) => (
))}
) }