@using Humanizer
@model EzeScanWebApps.Application.Files.Queries.FileHistoryModel
@{ ViewBag.Title = "File Management";}
@{ ViewBag.SubTitle = "History"; }

<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">History for file @Model.Name</div>
            <div class="card-body">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>
                                Time
                            </th>
                            <th>
                                Type
                            </th>
                            <th>
                                User
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var e in Model.Events)
                        {
                            <tr>
                                <td>
                                    @e.Timestamp.ToDateTimeOffset().Humanize()
                                </td>
                                <td>
                                    @e.Name
                                </td>
                                <td>
                                    @e.User
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>