Add Blazor application layer with UI components and pages
- Service interfaces and DTO models - Dashboard page with account overview - Account detail page with year/entry management - Reusable components: AccountCard, EntryTable, YearSelector - Dialog components: Add/Edit Account, Entry, Transfer, Year - Main layout and routing configuration
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
@page "/"
|
||||
@inject IAccountService AccountService
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Übersicht</h2>
|
||||
<button class="btn btn-primary" @onclick="() => showAddAccount = true">
|
||||
<i class="bi bi-plus-lg"></i> Neues Konto
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (accounts == null)
|
||||
{
|
||||
<div class="text-center py-5">
|
||||
<div class="spinner-border" role="status"></div>
|
||||
</div>
|
||||
}
|
||||
else if (!accounts.Any())
|
||||
{
|
||||
<div class="text-center py-5 text-muted">
|
||||
<h4>Noch keine Konten vorhanden</h4>
|
||||
<p>Erstelle dein erstes Konto, um loszulegen.</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<AccountCardList Accounts="accounts" />
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (showAddAccount)
|
||||
{
|
||||
<AddAccountDialog OnSave="HandleAccountCreated" OnCancel="() => showAddAccount = false" />
|
||||
}
|
||||
|
||||
@code {
|
||||
private List<AccountSummaryDto>? accounts;
|
||||
private bool showAddAccount;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAccounts();
|
||||
}
|
||||
|
||||
private async Task LoadAccounts()
|
||||
{
|
||||
accounts = await AccountService.GetAllAccountsAsync();
|
||||
}
|
||||
|
||||
private async Task HandleAccountCreated(string name)
|
||||
{
|
||||
await AccountService.CreateAccountAsync(name);
|
||||
showAddAccount = false;
|
||||
await LoadAccounts();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user