Refactor interaction handling with utility for translations

Introduced `TermHelper.Translate` to centralize string mappings for `InteractionType`, reducing duplication across components. Updated related code to leverage this utility and streamline interaction row implementation by removing the `Caption` parameter. Minor UI adjustments were also made to align button positioning and styling.
This commit is contained in:
Andre Beging
2025-03-28 20:31:25 +01:00
parent 350e2003ca
commit 0324e0f529
7 changed files with 70 additions and 45 deletions

View File

@@ -1,4 +1,7 @@
@using FoodsharingSiegen.Contracts.Entity
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
@{
var rowClass = "";
@@ -11,7 +14,7 @@
<th class="text-center align-top pr-2">
<i class="@IconClass"></i>
</th>
<th class="pr-2 align-top" style="white-space: nowrap;">@Caption:</th>
<th class="pr-2 align-top" style="white-space: nowrap;">@Type.Translate(AppSettings):</th>
<td class="align-top d-flex flex-column">
@if (Interactions.Count > 0)
{
@@ -39,7 +42,7 @@
{
if (Multiple) ButtonIconClass = "fa-solid fa-plus";
<div class="m-auto">
<Button Size="Size.Small" Clicked="AddClick"><i class="@ButtonIconClass" style="color: #64ae24;"></i></Button>
<Button Size="Size.Small" Clicked="@(async () => { if (AddClick != null) await AddClick(Type); })"><i class="@ButtonIconClass" style="color: #64ae24;"></i></Button>
</div>
}
</td>