@model dynamic
@{
    ViewBag.Title = $"Block {Model.BlockIndex}";
    Layout = "_Layout";
    ViewBag.Query = Model.BlockHash;
}
@section Style
{
    <style>
        #crafted {
            position: relative;
            color: #111111;
        }
    </style>
}
<partial name="SearchBlock" model="@(new SearchBlockExplorer())" />
<section class="block-explorer-section section bg-bottom">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="center-heading">
                    <h2 class="section-title">Details for Block #@Model.BlockIndex</h2>
                </div>
            </div>
        </div>			
        <div class="row m-bottom-70">
            <div class="col-lg-12 col-md-12 col-sm-12">
                <div class="table-responsive">
                    <table class="table table-striped table-latests table-detail">
                        <tbody>
                            <tr>
                                <td><strong>Address</strong></td>
                                <td>
                                    <a asp-controller="BlockExplorer" asp-action="Address" asp-route-address="@Model.BlockHash">@Model.BlockHash</a>
                                    <a href="#" class="copy-me"><i class="fa fa-copy"></i></a>
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Date/Time</strong></td>
                                <td>@DateTimeOffset.FromUnixTimeSeconds((long)Model.BlockTime).ToString("F")</td>
                            </tr>
                            <tr>
                                <td><strong>Block Size</strong></td>
                                <td>@Model.BlockSize bytes</td>
                            </tr>
                            <tr>
                                <td><strong>Previous Block Hash</strong></td>
                                <td>
                                    <a asp-controller="BlockExplorer" asp-action="BlockHash" asp-route-hash="@Model.PreviousBlockHash">@(Model.PreviousBlockHash??"-")</a>
                                </td>
                            </tr>
                            <tr>
                                <td><strong>Next Block Hash</strong></td>
                                <td>
                                    <a asp-controller="BlockExplorer" asp-action="BlockHash" asp-route-hash="@Model.NextBlockHash">@(Model.NextBlockHash??"-")</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="center-heading">
                    <h2 class="section-title">Transactions</h2>
                </div>
            </div>
        </div>			
        <div class="row">
            <div class="col-lg-12">
                <div class="table-responsive">
                    <table class="table table-striped table-latests">
                        <thead>
                            <tr>
                                <th>Index</th>
                                <th>Transaction ID</th>
                            </tr>
                        </thead>
                        <tbody>
                            @{ int i = 0;}
                            @foreach (var transaction in Model.Transactions)
                            {
                                <tr>
                                    <td>@i</td>
                                    <td>
                                        <a asp-controller="BlockExplorer" asp-action="Transaction" asp-route-transactionId="@transaction">@transaction</a>
                                    </td>
                                </tr>
                                i++;
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
