<script>
  import { _ } from "svelte-i18n";
  import { MeService } from "@odit/lfk-client-js";
  $: original_data = {};
  $: editable = {};
  const user_promise = MeService.meControllerGetPermissions().then((data) => {
    original_data = Object.assign(original_data, data);
    editable = Object.assign(editable, original_data);
  });
</script>

<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12">
  <div class="text-center mb-8">
    <h1
      class="mt-9 font-display text-4xl leading-none font-semibold text-white sm:text-5xl lg:text-6xl">
      🔨<br />{$_('settings')}
    </h1>
  </div>
</div>

<div class="pt-0 pb-16 bg-gray-50 overflow-hidden lg:pt-12 lg:py-24">
  <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
    <div>
      <div class="md:grid md:grid-cols-3 md:gap-6">
        <div class="md:col-span-1">
          <div class="px-4 sm:px-0">
            <h3 class="text-lg font-medium leading-6 text-gray-900">
              {$_('profile')}
            </h3>
            <p class="mt-1 text-sm text-gray-600">
              {$_('everything-concerning-your-profile')}
            </p>
          </div>
        </div>
        <div class="mt-5 md:mt-0 md:col-span-2">
          <div class="shadow sm:rounded-md sm:overflow-hidden">
            <div class="px-4 py-5 bg-white space-y-6 sm:p-6">
              <div>
                <!-- svelte-ignore a11y-label-has-associated-control -->
                <label class="block text-sm font-medium text-gray-700">
                  {$_('profile-picture')}
                </label>
                <div class="mt-2 flex items-center">
                  <span
                    class="inline-block h-20 w-20 rounded-full overflow-hidden bg-gray-100">
                    <img
                      alt={$_('profile-picture')}
                      class="h-20 w-20 rounded-full overflow-hidden bg-gray-100"
                      src={editable.profilePic} />
                  </span>
                  <button
                    type="button"
                    class="ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                    Change
                  </button>
                </div>
              </div>
            </div>
            <div class="px-4 py-3 bg-gray-50 text-right sm:px-6">
              <button
                type="submit"
                class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                Save
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
