@page "/audit"

@using FoodsharingSiegen.Server.BaseClasses
@using FoodsharingSiegen.Contracts.Entity
@using FoodsharingSiegen.Server.Data

@inherits FsBase

<PageTitle>Aktivitäten - @AppSettings.Title</PageTitle>

<div class="d-flex flex-column p-audit">
    <h2>Aktivitäten</h2>
    
    <DataGrid TItem="Audit"
              Data="@Audits"
              VirtualizeOptions="@(new() { DataGridHeight = "100%", DataGridMaxHeight = "100%"})"
              Virtualize="true"
              Responsive>
        <DataGridColumn Field="@nameof(Audit.Created)" Caption="Datum" Width="180px" />
        <DataGridColumn Caption="Aktion">
            <DisplayTemplate>
                <span>
                    @((context as Audit).User?.Name) @(AuditHelper.CreateText(context))
                </span>
            </DisplayTemplate>
        </DataGridColumn>
    </DataGrid>
</div>

