@@ -14,7 +14,11 @@ import { Button } from '../theme/Button';
1414import { StepperInlineInput } from '../theme/StepperInlineInput' ;
1515import { TextInput } from '../theme/TextInput' ;
1616import { FullScreenModal } from './FullScreenModal' ;
17- import { type MuscleGroup } from '../../database/models' ;
17+ import {
18+ type EquipmentType ,
19+ type MechanicType ,
20+ type MuscleGroup ,
21+ } from '../../database/models' ;
1822
1923// UI-specific muscle group filter type (subset of MuscleGroup + 'all')
2024type MuscleGroupFilter = 'all' | 'chest' | 'back' | 'legs' | 'arms' ;
@@ -23,7 +27,7 @@ type ExerciseId = string;
2327
2428type ExerciseOption = SelectorOption < ExerciseId > & {
2529 category : string ;
26- type : 'compound' | 'isolation' | 'bodyweight' | 'machine' ;
30+ type : MechanicType | EquipmentType ;
2731} ;
2832
2933type AddExerciseModalProps = {
@@ -66,20 +70,20 @@ const normalizeMuscleGroup = (muscleGroup: MuscleGroup | string): MuscleGroupFil
6670const getExerciseType = (
6771 mechanicType : string ,
6872 equipmentType : string
69- ) : 'compound' | 'isolation' | 'bodyweight' | 'machine' => {
73+ ) : MechanicType | EquipmentType => {
7074 const mechanic = mechanicType ?. toLowerCase ( ) || '' ;
7175 const equipment = equipmentType ?. toLowerCase ( ) || '' ;
7276
7377 if ( equipment . includes ( 'bodyweight' ) || equipment . includes ( 'body weight' ) ) {
74- return 'bodyweight' ;
78+ return 'bodyweight' as EquipmentType ;
7579 }
7680 if ( mechanic . includes ( 'compound' ) ) {
77- return 'compound' ;
81+ return 'compound' as MechanicType ;
7882 }
7983 if ( equipment . includes ( 'machine' ) ) {
80- return 'machine' ;
84+ return 'machine' as EquipmentType ;
8185 }
82- return 'isolation' ;
86+ return 'isolation' as MechanicType ;
8387} ;
8488
8589// Helper function to get icon for exercise type
0 commit comments