feat(i18n): traducir Inicio
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import type { NextClassDto } from '@gruperly/shared'
|
||||
import { CalendarClock } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Button } from '../../components/ui'
|
||||
import { formatRelativeDateTime, formatSchedule } from '../../lib/format'
|
||||
|
||||
export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) {
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('home')
|
||||
const hasSchedule = (nextClass.days?.length ?? 0) > 0
|
||||
|
||||
return (
|
||||
@@ -13,7 +15,7 @@ export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) {
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4">
|
||||
<div className="min-w-0">
|
||||
<p className="text-xs font-medium uppercase tracking-wide text-foreground/50">
|
||||
{nextClass.isNow ? 'Clase en curso' : 'Próxima clase'}
|
||||
{nextClass.isNow ? t('nextClass.now') : t('nextClass.next')}
|
||||
</p>
|
||||
<h2 className="mt-1 truncate text-xl font-bold text-primary">{nextClass.name}</h2>
|
||||
{hasSchedule ? (
|
||||
@@ -25,7 +27,7 @@ export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) {
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
<Badge variant={nextClass.isNow ? 'success' : 'neutral'}>
|
||||
{nextClass.isNow ? 'En curso ahora' : formatRelativeDateTime(nextClass.occurrenceAt)}
|
||||
{nextClass.isNow ? t('nextClass.nowBadge') : formatRelativeDateTime(nextClass.occurrenceAt)}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +37,7 @@ export function NextClassHero({ nextClass }: { nextClass: NextClassDto }) {
|
||||
size="sm"
|
||||
onClick={() => void navigate({ to: `/groups/${nextClass.groupId}` })}
|
||||
>
|
||||
Ver grupo
|
||||
{t('nextClass.seeGroup')}
|
||||
</Button>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user