{% extends "/layouts/main.twig" %}
{% set active_menu = 'settings' %}

{% set xdata = 'settings' %}
{% block title p__('title', 'Features') %}

{% block template %}
<div>
  {% include "snippets/back.twig" with {link: 'admin/settings', label: 'Settings'} %}

  <h1 class="mt-4">{{ p__('heading', 'Features') }}</h1>
</div>

<x-form>
  <form class="flex flex-col gap-8" @submit.prevent="submit" x-ref="form">
    <div class="flex flex-col gap-2">
      <section class="flex flex-col gap-6 box" data-density="comfortable">
        <h2 class="col-span-2">{{ p__('heading', 'Tools') }}</h2>

        <div class="grid grid-cols-2 gap-4">
          <label
            class="flex items-center gap-4 cursor-pointer box hover:border-line">
            <div>
              <div class="label">{{ p__('heading', 'Coder') }}</div>
              <p class="font-normal text-content-dimmed">
                {{ p__('coder-tool-description', 'Ready to write code at the speed of light?') }}
              </p>
            </div>

            <div class="ml-auto">
              <input type="checkbox" name="features[coder][is_enabled]"
                class="hidden peer"
                {{ option.features.coder.is_enabled is defined and option.features.coder.is_enabled ? 'checked' : '' }}>

              <span
                class="h-6 w-10 rounded-3xl bg-line relative block peer-checked:bg-success transition-all after:h-5 after:w-5 after:top-0.5 after:absolute after:left-0 after:ml-0.5 after:transition-all after:rounded-full after:bg-white peer-checked:after:left-4"></span>
            </div>
          </label>

          <label
            class="flex items-center gap-4 cursor-pointer box hover:border-line">
            <div>
              <div class="label">{{ p__('heading', 'Transcriber') }}</div>
              <p class="font-normal text-content-dimmed">
                {{ p__('transcriber-tool-description', 'Instantly transcribe spoken words into text.')  }}
              </p>
            </div>

            <div class="ml-auto">
              <input type="checkbox" name="features[transcriber][is_enabled]"
                class="hidden peer"
                {{ option.features.transcriber.is_enabled is defined and option.features.transcriber.is_enabled ? 'checked' : '' }}>

              <span
                class="h-6 w-10 rounded-3xl bg-line relative block peer-checked:bg-success transition-all after:h-5 after:w-5 after:top-0.5 after:absolute after:left-0 after:ml-0.5 after:transition-all after:rounded-full after:bg-white peer-checked:after:left-4"></span>
            </div>
          </label>

          <a href="admin/settings/features/writer"
            class="flex items-center gap-4 text-sm cursor-pointer box hover:border-line">
            <div>
              <div class="label">{{ p__('heading', 'Writer') }}</div>
              <p class="font-normal text-content-dimmed">
                {{ p__('writer-tool-description', 'Write SEO optimized blogs, sales emails and more...') }}
              </p>
            </div>

            <i class="ml-auto ti ti-chevron-right"></i>
          </a>

          <a href="admin/settings/features/imagine"
            class="flex items-center gap-4 text-sm cursor-pointer box hover:border-line">
            <div>
              <div class="font-bold">{{ p__('heading', 'Imagine') }}</div>
              <p class="text-content-dimmed">
                {{ p__('imagine-tool-description', 'Visualize what you dream of. Create images from text.') }}
              </p>
            </div>

            <i class="ml-auto ti ti-chevron-right"></i>
          </a>


          <a href="admin/settings/features/voiceover"
            class="flex items-center gap-4 text-sm cursor-pointer box hover:border-line">
            <div>
              <div class="font-bold">{{ p__('heading', 'Voiceover') }}</div>
              <p class="text-content-dimmed">
                {{ p__('voiceover-tool-description', 'Convert your texts into lifelike speech') }}
              </p>
            </div>

            <i class="ml-auto ti ti-chevron-right"></i>
          </a>

          <a href="admin/settings/features/chat"
            class="flex items-center gap-4 text-sm cursor-pointer box hover:border-line">
            <div>
              <div class="font-bold">{{ p__('heading', 'Chat') }}</div>
              <p class="text-content-dimmed">
                {{ p__('chat-tool-description', 'Chat with AI assistants') }}
              </p>
            </div>

            <i class="ml-auto ti ti-chevron-right"></i>
          </a>
        </div>
      </section>
    </div>

    <div class="flex justify-end gap-4">
      <a href="admin/settings" class="button button-outline">
        {{ p__('button', 'Cancel') }}
      </a>

      <button class="button button-accent" type="submit"
        :processing="isProcessing">
        {% include "/snippets/spinner.twig" %}

        {{ p__('button', 'Save changes') }}
      </button>
    </div>
  </form>
</x-form>
{% endblock %}