Dashboard: przycisk 'Utworz plan' w gornym narozniku karty 'Nastepny trening' (jak 'Zobacz wszystkie')

This commit is contained in:
Tilumca
2026-10-15 02:38:02 +02:00
parent e2c59b6ed2
commit 3a5e352b96

View File

@@ -424,7 +424,7 @@ export default function Dashboard() {
<Card>
<div className="mb-1.5 flex flex-wrap items-baseline justify-between gap-2">
<SectionHeader title="Następny trening" />
{data.nextTraining && (
{data.nextTraining ? (
<span className="text-dim text-[0.8125rem]">
{new Date(data.nextTraining.date).toLocaleDateString('pl-PL', {
weekday: 'long',
@@ -432,6 +432,15 @@ export default function Dashboard() {
month: 'long',
})}
</span>
) : (
!data.activePlan && (
<Link to="/plans/new">
<Button size="sm">
<Flame className="h-4 w-4" />
Utwórz plan
</Button>
</Link>
)
)}
</div>
{data.nextTraining ? (
@@ -465,16 +474,6 @@ export default function Dashboard() {
? 'Wszystko zrobione — czekaj na kolejny dzień z planu.'
: 'Utwórz plan, aby rozpocząć treningi.'
}
action={
!data.activePlan ? (
<Link to="/plans/new">
<Button>
<Flame className="h-4 w-4" />
Utwórz plan
</Button>
</Link>
) : undefined
}
/>
)}
</Card>