@using Moonlight.App.Database.Entities
@using Moonlight.App.Services

@inject WebsiteService WebsiteService

<div class="card card-flush h-xl-100">
    <div class="card-body pt-2">
        <LazyLoader Load="Load">
            <div class="mt-7 row fv-row mb-7">
                <div class="col-md-3 text-md-start">
                    <label class="fs-6 fw-semibold form-label mt-3">
                        <TL>Ftp Host</TL>
                    </label>
                </div>
                <div class="col-md-9">
                    <input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(FtpHost)">
                </div>
            </div>
            <div class="row fv-row mb-7">
                <div class="col-md-3 text-md-start">
                    <label class="fs-6 fw-semibold form-label mt-3">
                        <TL>Ftp Port</TL>
                    </label>
                </div>
                <div class="col-md-9">
                    <input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="21">
                </div>
            </div>
            <div class="row fv-row mb-7">
                <div class="col-md-3 text-md-start">
                    <label class="fs-6 fw-semibold form-label mt-3">
                        <TL>Ftp Username</TL>
                    </label>
                </div>
                <div class="col-md-9">
                    <input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(Website.FtpLogin)">
                </div>
            </div>
            <div class="row fv-row mb-7">
                <div class="col-md-3 text-md-start">
                    <label class="fs-6 fw-semibold form-label mt-3">
                        <TL>Ftp Password</TL>
                    </label>
                </div>
                <div class="col-md-9">
                    <input type="text" class="form-control form-control-solid disabled blur-unless-hover" disabled="disabled" value="@(Website.FtpPassword)">
                </div>
            </div>
        </LazyLoader>
    </div>
</div>

@code
{
    [CascadingParameter]
    public Website Website { get; set; }

    private string FtpHost = "N/A";

    private async Task Load(LazyLoader arg)
    {
        FtpHost = await WebsiteService.GetHost(Website.PleskServer);
    }
}