|
1 |
| - @{ |
2 |
| - var splitWeights = (Exercise.PerSetWeight |
3 |
| - && Exercise.PotentialSets.DistinctBy(x=>x.Set?.RepsCompleted).Count() != 1); |
4 |
| - var numCompletedSets = Exercise.PotentialSets.Count(x => x.Set != null); |
5 |
| - var maxNumReps = Exercise.PotentialSets.Max(x => x.Set?.RepsCompleted ?? 0); |
6 | 1 |
|
7 |
| - var (numSets, numReps) = IsFilled switch |
8 |
| - { |
9 |
| - true => (numCompletedSets, maxNumReps), |
10 |
| - false => (Exercise.Blueprint.Sets, Exercise.Blueprint.RepsPerSet) |
11 |
| - }; |
12 |
| -} |
13 |
| -<span class="flex items-center"> |
| 2 | +<span class="flex items-center gap-2"> |
14 | 3 | @if(ShowName)
|
15 | 4 | {
|
16 | 5 | <span>@Exercise.Blueprint.Name</span>
|
17 | 6 | }
|
18 |
| - @if(ShowSets || ShowWeight) |
19 |
| - { |
20 |
| - @if(!splitWeights) |
| 7 | + <span class="flex ml-auto overflow-x-auto gap-1"> |
| 8 | + @if(IsFilled) |
21 | 9 | {
|
22 |
| - <span class="flex justify-around ml-auto items-center gap-0.5 bg-surface-container-highest text-on-surface-variant rounded-md py-1 px-2"> |
23 |
| - |
24 |
| - @if (ShowSets) |
| 10 | + @foreach(var chip in GetWeightAndRepsChips()) |
25 | 11 | {
|
26 |
| - <span>@(numSets)x@(numReps) |
| 12 | + <span class="flex items-center gap-0.5 bg-surface-container-highest text-on-surface-variant rounded-md py-1 px-2"> |
| 13 | + <span>@(chip.RepsCompleted?.ToString() ?? "-")</span><span class="text-2xs">@@</span> |
| 14 | + <WeightFormat Weight="@chip.Weight"/> |
27 | 15 | </span>
|
28 |
| - @if(ShowWeight) |
29 |
| - { |
30 |
| - <span class="text-2xs">@@</span> |
31 |
| - } |
32 | 16 | }
|
| 17 | + } else |
| 18 | + { |
33 | 19 |
|
34 |
| - @if (ShowWeight) |
| 20 | + @foreach(var chip in GetPlannedChipData()) |
35 | 21 | {
|
36 |
| - <WeightFormat Weight="@Exercise.MaxWeight"/> |
| 22 | + <span class="flex items-center gap-0.5 bg-surface-container-highest text-on-surface-variant rounded-md py-1 px-2"> |
| 23 | + <span>@(chip.NumSets)x@(chip.RepTarget)</span><span class="text-2xs">@@</span> |
| 24 | + <WeightFormat Weight="@chip.Weight"/> |
| 25 | + </span> |
37 | 26 | }
|
38 |
| - </span> |
39 | 27 | }
|
40 |
| - |
41 |
| - @if (ShowWeight && splitWeights) |
42 |
| - { |
43 |
| - <span class="flex ml-auto flex-wrap justify-end gap-1"> |
44 |
| - @foreach(var set in Exercise.PotentialSets) |
45 |
| - { |
46 |
| - if(set.Set?.RepsCompleted == null) |
47 |
| - { |
48 |
| - continue; |
49 |
| - } |
50 |
| - <span class="flex items-center gap-0.5 bg-surface-container-highest text-on-surface-variant rounded-md py-1 px-2"> |
51 |
| - @if (ShowSets){ |
52 |
| - <span>@(set.Set?.RepsCompleted ?? Exercise.Blueprint.RepsPerSet)</span><span class="text-2xs">@@</span> |
53 |
| - } |
54 |
| - <WeightFormat Weight="@set.Weight"/> |
55 |
| - </span> |
56 |
| - } |
57 |
| - </span> |
58 |
| - } |
59 |
| - } |
| 28 | + </span> |
60 | 29 | </span>
|
61 | 30 |
|
62 | 31 | @code
|
63 | 32 | {
|
64 | 33 | [EditorRequired] [Parameter] public RecordedExercise Exercise { get; set; } = null!;
|
65 | 34 |
|
66 |
| - [Parameter] public bool ShowSets { get; set; } |
67 |
| - |
68 |
| - [Parameter] public bool ShowWeight { get; set; } |
69 |
| - |
70 | 35 | [Parameter] public bool ShowName { get; set; }
|
71 | 36 |
|
72 | 37 | [Parameter] public bool IsFilled { get; set; } = true;
|
|
0 commit comments