@inject BTCPayServer.HostedServices.CssThemeManager themeManager

@model ViewPointOfSaleViewModel
@{
    ViewData["Title"] = Model.Title;
    Layout = null;
}

<!DOCTYPE html>
<html class="h-100">
<head>
    <title>@Model.Title</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link href="@this.Context.Request.GetAbsoluteUri(themeManager.BootstrapUri)" rel="stylesheet" />
</head>
<body class="h-100">
    <div class="container d-flex h-100">
        <div class="justify-content-center align-self-center text-center mx-auto" style="margin: auto;">
            <h1 class="mb-4">@Model.Title</h1>
            <form method="post" asp-antiforgery="false">
                <div class="row">
                    @for(int i = 0; i < Model.Items.Length; i++)
                    {
                        var className = (Model.Items.Length - i) > (Model.Items.Length % 3) ? "col-sm-4 mb-3" : "col align-self-center";
                        var item = Model.Items[i];
                        <div class="@className">
                            <h3>@item.Title</h3>
                            <button type="submit" name="choiceKey" class="btn btn-primary" value="@item.Id">Buy for @item.Price.Formatted</button>
                        </div>
                    }
                </div>
            </form>
            @if(Model.ShowCustomAmount)
            {
                <div class="row mt-4">
                    <div class="col-md-4 offset-md-4 col-sm-6 offset-sm-3">
                        <form method="post" asp-antiforgery="false" data-buy>
                            <div class="input-group">
                                <input class="form-control" type="number" min="0" step="@Model.Step" name="amount" placeholder="amount"><div class="input-group-append">
                                    <button class="btn btn-primary" type="submit">Pay</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            }
        </div>
    </div>
    <script src="~/vendor/jquery/jquery.js"></script>
    <script src="~/vendor/bootstrap4/js/bootstrap.js"></script>
</body>
</html>
