diff --git a/components/ExerciseModal.tsx b/components/ExerciseModal.tsx index e84df02..67896ed 100644 --- a/components/ExerciseModal.tsx +++ b/components/ExerciseModal.tsx @@ -17,6 +17,7 @@ const ExerciseModal: React.FC = ({ isOpen, onClose, onSave, const [newName, setNewName] = useState(''); const [newType, setNewType] = useState(ExerciseType.STRENGTH); const [newBwPercentage, setNewBwPercentage] = useState('100'); + const [isUnilateral, setIsUnilateral] = useState(false); const [error, setError] = useState(''); const exerciseTypeLabels: Record = { @@ -47,12 +48,14 @@ const ExerciseModal: React.FC = ({ isOpen, onClose, onSave, id: generateId(), name: trimmedName, type: newType, + isUnilateral, ...(newType === ExerciseType.BODYWEIGHT && { bodyWeightPercentage: parseFloat(newBwPercentage) || 100 }) }; await onSave(newEx); setNewName(''); setNewType(ExerciseType.STRENGTH); setNewBwPercentage('100'); + setIsUnilateral(false); setError(''); onClose(); }; @@ -120,6 +123,19 @@ const ExerciseModal: React.FC = ({ isOpen, onClose, onSave, /> )} +
+ setIsUnilateral(e.target.checked)} + className="w-5 h-5 rounded border-2 border-outline bg-surface-container-high checked:bg-primary checked:border-primary cursor-pointer" + /> + +
+