feat: enhance TrainingUnitSectionsEditor with heading accessory support
- Added a new `headingAccessory` prop to TrainingUnitSectionsEditor for customizable header content. - Updated the component to conditionally render the heading and accessory in a flexible toolbar layout. - Refactored TrainingFrameworkProgramEditPage and TrainingPlanningPage to utilize the new heading accessory feature, improving user interaction and layout consistency.
This commit is contained in:
1 parent
2bfe67879f
commit
4080088d42
4 files changed
+72
-70
No files matched your search
@@ -18,6 +18,28 @@ export function exerciseRow() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function hydrateExercisePlanningRow(exercise) {
|
||||
let variants = Array.isArray(exercise?.variants) ? exercise.variants : []
|
||||
let title = exercise?.title || ''
|
||||
const id = exercise?.id
|
||||
if (!id) return null
|
||||
if (!variants.length) {
|
||||
try {
|
||||
const full = await api.getExercise(id)
|
||||
variants = Array.isArray(full?.variants) ? full.variants : []
|
||||
title = full?.title || title
|
||||
} catch {
|
||||
variants = []
|
||||
}
|
||||
}
|
||||
const row = exerciseRow()
|
||||
row.exercise_id = id
|
||||
row.exercise_variant_id = ''
|
||||
row.exercise_title = title
|
||||
row.variants = variants
|
||||
return row
|
||||
}
|
||||
|
||||
export function noteRow() {
|
||||
return { item_type: 'note', note_body: '' }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user