import { Link } from '@tanstack/react-router' import type { NextClassDto } from '@gruperly/shared' import { ChevronRight } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Badge } from '../../components/ui' import { formatRelativeDateTime, formatSchedule } from '../../lib/format' /** El hero cuando hoy ya no queda ninguna clase por dar: la próxima, sea cuando sea. */ export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) { const { t } = useTranslation('home') const hasSchedule = (nextClass.days?.length ?? 0) > 0 return (

{nextClass.name}

{nextClass.isNow ? t('nextClass.now') : t('nextClass.next')} {nextClass.isNow ? t('nextClass.nowBadge') : formatRelativeDateTime(nextClass.occurrenceAt)}

{hasSchedule ? (

{formatSchedule(nextClass.days ?? [], nextClass.time)}

) : null} ) }