1. Exercise lists sorted. 2. Session finishing confirmation. 3. Quit without saving option added.

This commit is contained in:
aodulov
2025-11-26 09:32:29 +02:00
parent dafb8664ed
commit 34738697df
4 changed files with 128 additions and 22 deletions

View File

@@ -275,16 +275,19 @@ const Plans: React.FC<PlansProps> = ({ userId, onStartPlan, lang }) => {
</div>
</div>
<div className="flex-1 overflow-y-auto p-2">
{availableExercises.map(ex => (
<button
key={ex.id}
onClick={() => addStep(ex)}
className="w-full text-left p-4 border-b border-outline-variant hover:bg-surface-container-high text-on-surface flex justify-between"
>
<span>{ex.name}</span>
<span className="text-xs bg-secondary-container text-on-secondary-container px-2 py-1 rounded-full">{ex.type}</span>
</button>
))}
{availableExercises
.slice()
.sort((a, b) => a.name.localeCompare(b.name))
.map(ex => (
<button
key={ex.id}
onClick={() => addStep(ex)}
className="w-full text-left p-4 border-b border-outline-variant hover:bg-surface-container-high text-on-surface flex justify-between"
>
<span>{ex.name}</span>
<span className="text-xs bg-secondary-container text-on-secondary-container px-2 py-1 rounded-full">{ex.type}</span>
</button>
))}
</div>
{isCreatingExercise && (