@page "/settings"
@using Server.Data
@rendermode InteractiveServer

<h3>Einstellungen</h3>

<button type="button" class="btn btn-primary" @onclick="Save"><i class="fas fa-save"></i> Speichern</button>

<div class="row">
  <div class="col-md-6 col-xl-4 col-xxl-3">
    <hr/>
    <h4><i class="fas fa-address-card"></i> Adressdaten</h4>
    <div class="mb-3">
      <label class="form-label">Name</label>
      <InputText DisplayName="Name" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.Name"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">Name 2</label>
      <InputText DisplayName="Name 2" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.Name2"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">Straße</label>
      <InputText DisplayName="Straße" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.Street"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">PLZ</label>
      <InputText DisplayName="PLZ" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.Zip"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">Stadt</label>
      <InputText DisplayName="Stadt" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.City"></InputText>
    </div>
  </div>
  <div class="col-md-6 col-xl-4 col-xxl-3">
    <hr/>
    <h4><i class="fas fa-money-bill-alt"></i> Bankverbindung</h4>
    <div class="mb-3">
      <label class="form-label">Name der Bank</label>
      <InputText DisplayName="Name der Bank" class="form-control"
                 @bind-Value="@SettingsData.Instance.PaymentData.BankName"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">IBAN</label>
      <InputText DisplayName="IBAN" class="form-control"
                 @bind-Value="@SettingsData.Instance.PaymentData.Iban"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">BIC</label>
      <InputText DisplayName="BIC" class="form-control"
                 @bind-Value="@SettingsData.Instance.PaymentData.Bic"></InputText>
    </div>

  </div>
  <div class="col-md-6 col-xl-4 col-xxl-3">
    <hr/>
    <h4><i class="fas fa-mobile-alt"></i> Kontaktdaten</h4>
    <div class="mb-3">
      <label class="form-label">Telefon</label>
      <InputText DisplayName="Telefon" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.Phone"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">Web</label>
      <InputText DisplayName="Web" class="form-control" @bind-Value="@SettingsData.Instance.SellerAddress.Web"></InputText>
    </div>

    <div class="mb-3">
      <label class="form-label">Steuernummer</label>
      <InputText DisplayName="Steuernummer" class="form-control"
                 @bind-Value="@SettingsData.Instance.SellerAddress.TaxId"></InputText>
    </div>
    
    <div class="mb-3">
      <div style="display: inline;">
        <div class="btn-group btn-group-sm" role="group">
          <input type="radio" class="btn-check" name="options-outlined" id="switch-on" autocomplete="off" checked="@(SettingsData.Instance.Kleinunternehmer)" @onchange="@(() => SettingsData.Instance.Kleinunternehmer = true)">
          <label class="btn btn-outline-primary" for="switch-on">An</label>

          <input type="radio" class="btn-check" name="options-outlined" id="switch-off" autocomplete="off" checked="@(!SettingsData.Instance.Kleinunternehmer)" @onchange="@(() => SettingsData.Instance.Kleinunternehmer = false)">
          <label class="btn btn-outline-primary" for="switch-off">Aus</label>
        </div>
      </div>
      Kleinunternehmerregelung
    </div>
  </div>
  <div class="col-md-6 col-xl-4 col-xxl-3">
    <hr/>
    <h4><i class="fas fa-palette"></i> Personalisierung</h4>
    <div class="mb-3">
      <label class="form-label">Kommentar</label>
      <InputTextArea DisplayName="Kommentar" class="form-control" rows="3"
                     @bind-Value="@SettingsData.Instance.Comment"></InputTextArea>
    </div>
    <div class="mb-3">
      <label class="form-label">Logo Pfad</label>
      <InputText class="form-control" @bind-Value="@SettingsData.Instance.Logo"></InputText>
    </div>
  </div>
</div>