|
| 1 | +@namespace PrompterOne.Shared.Components.Settings |
| 2 | + |
| 3 | +<SettingsExpandableCard Title="@Title" |
| 4 | + Subtitle="@Subtitle" |
| 5 | + StatusLabel="@StatusLabel" |
| 6 | + StatusClass="@StatusClass" |
| 7 | + IconStyle="@IconStyle" |
| 8 | + AdditionalCssClass="@AdditionalCssClass" |
| 9 | + IsOpen="@IsOpen" |
| 10 | + OnToggle="@OnToggle" |
| 11 | + TestId="@TestId"> |
| 12 | + <Icon> |
| 13 | + @if (Icon is not null) |
| 14 | + { |
| 15 | + @Icon |
| 16 | + } |
| 17 | + </Icon> |
| 18 | + |
| 19 | + <ChildContent> |
| 20 | + @if (ChildContent is not null) |
| 21 | + { |
| 22 | + @ChildContent |
| 23 | + } |
| 24 | + |
| 25 | + <div class="set-path-field" style="margin-top:12px"> |
| 26 | + <button class="set-btn-golden set-btn-sm" |
| 27 | + type="button" |
| 28 | + data-testid="@SaveTestId" |
| 29 | + @onclick="Save" |
| 30 | + @onclick:stopPropagation="true"> |
| 31 | + Save locally |
| 32 | + </button> |
| 33 | + <button class="set-btn-outline set-btn-sm" |
| 34 | + type="button" |
| 35 | + data-testid="@ClearTestId" |
| 36 | + @onclick="Clear" |
| 37 | + @onclick:stopPropagation="true"> |
| 38 | + Clear |
| 39 | + </button> |
| 40 | + </div> |
| 41 | + |
| 42 | + @if (!string.IsNullOrWhiteSpace(Message)) |
| 43 | + { |
| 44 | + <p class="set-card-copy" |
| 45 | + data-testid="@MessageTestId"> |
| 46 | + @Message |
| 47 | + </p> |
| 48 | + } |
| 49 | + </ChildContent> |
| 50 | +</SettingsExpandableCard> |
| 51 | + |
| 52 | +@code { |
| 53 | + [Parameter] public string AdditionalCssClass { get; set; } = string.Empty; |
| 54 | + |
| 55 | + [Parameter] public RenderFragment? ChildContent { get; set; } |
| 56 | + |
| 57 | + [Parameter] public EventCallback Clear { get; set; } |
| 58 | + |
| 59 | + [Parameter] public string ClearTestId { get; set; } = string.Empty; |
| 60 | + |
| 61 | + [Parameter] public RenderFragment? Icon { get; set; } |
| 62 | + |
| 63 | + [Parameter] public string IconStyle { get; set; } = string.Empty; |
| 64 | + |
| 65 | + [Parameter] public bool IsOpen { get; set; } |
| 66 | + |
| 67 | + [Parameter] public string Message { get; set; } = string.Empty; |
| 68 | + |
| 69 | + [Parameter] public string MessageTestId { get; set; } = string.Empty; |
| 70 | + |
| 71 | + [Parameter] public EventCallback OnToggle { get; set; } |
| 72 | + |
| 73 | + [Parameter] public EventCallback Save { get; set; } |
| 74 | + |
| 75 | + [Parameter] public string SaveTestId { get; set; } = string.Empty; |
| 76 | + |
| 77 | + [Parameter] public string StatusClass { get; set; } = string.Empty; |
| 78 | + |
| 79 | + [Parameter] public string StatusLabel { get; set; } = string.Empty; |
| 80 | + |
| 81 | + [Parameter] public string Subtitle { get; set; } = string.Empty; |
| 82 | + |
| 83 | + [Parameter] public string TestId { get; set; } = string.Empty; |
| 84 | + |
| 85 | + [Parameter] public string Title { get; set; } = string.Empty; |
| 86 | +} |
0 commit comments