@page "/pdf-reader"
@inject IStringLocalizer<PdfReaders> Localizer

<h3>@Localizer["PdfTitle"]</h3>
<h3>@Localizer["PdfDescription"]</h3>

<PackageTips Name="BootstrapBlazor.PdfReader" />

<DemoBlock Title="@Localizer["PdfReaderNormalText"]" Introduction="@Localizer["PdfReaderNormalIntro"]" Name="Normal">
    <p>@((MarkupString)Localizer["PdfReaderFAIconDesc"].Value)</p>
    <Pre>&lt;link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css"]" /&gt;</Pre>
    <ul class="ul-demo">
        <li>@((MarkupString)Localizer["PdfReaderSetPdfStreamDesc"].Value)</li>
        <li>@((MarkupString)Localizer["PdfReaderDownloadFileNameDesc"].Value)</li>
    </ul>
    <section ignore class="row form-inline g-3" style="--bb-input-group-label-width: 176px;">
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel>ShowToolbar</BootstrapInputGroupLabel>
                <Switch @bind-Value="_showToolbar"></Switch>
            </BootstrapInputGroup>
        </div>
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel>ShowDownload</BootstrapInputGroupLabel>
                <Switch @bind-Value="_showDownload"></Switch>
            </BootstrapInputGroup>
        </div>
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel>EnableThumbnails</BootstrapInputGroupLabel>
                <Switch @bind-Value="_enableThumbnails"></Switch>
            </BootstrapInputGroup>
        </div>
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel>ShowPrint</BootstrapInputGroupLabel>
                <Switch @bind-Value="_showPrint"></Switch>
            </BootstrapInputGroup>
        </div>
        <div class="col-12 col-sm-6">
            <BootstrapInputGroup>
                <BootstrapInputGroupLabel>ShowTwoPagesOneView</BootstrapInputGroupLabel>
                <Switch @bind-Value="_showTwoPagesOneView"></Switch>
            </BootstrapInputGroup>
        </div>
        <div class="col-12">
            <Button Color="Color.Primary" OnClick="@(() => _url = "./samples/sample.pdf")" class="me-2">Sample-Url</Button>
            <Button Color="Color.Primary" OnClick="@(() => _url = "./samples/sample2.pdf")" class="me-2">Sample2-Url</Button>
            <Button Color="Color.Danger" OnClick="GetSampleStream" class="me-2">Sample-Stream</Button>
            <Button Color="Color.Danger" OnClick="GetTestStream">Sample2-Stream</Button>
        </div>
    </section>
    <PdfReader Url="@_url" EnableThumbnails="_enableThumbnails"
               ShowTwoPagesOneView="_showTwoPagesOneView" ShowDownload="_showDownload"
               ShowToolbar="_showToolbar" ShowPrint="_showPrint"
               ViewHeight="600px" OnGetStreamAsync="OnGetStreamAsync"></PdfReader>
</DemoBlock>
