<.simple_form :let={f} for={@changeset} action={@action}>
  <.error :if={@changeset.action}>
    Oops, something went wrong! Please check the errors below.
  </.error>

  <h3 class="my-4 text-2xl text-black dark:text-white">
    General Options
  </h3>
  <.input
    field={f[:name]}
    type="text"
    label="Name"
    placeholder="New Profile"
    help="Something descriptive. Does not impact indexing or downloading (required)"
  />

  <.input
    field={f[:output_path_template]}
    type="text"
    inputclass="font-mono"
    label="Output path template"
    help="Must end with .{{ ext }}. See below for more details. The default is good for most cases (required)"
  />

  <h3 class="mt-8 text-2xl text-black dark:text-white">
    Subtitle Options
  </h3>
  <.input
    field={f[:download_subs]}
    type="toggle"
    label="Download Subtitles"
    help="Downloads subtitle files alongside media file"
  />
  <.input
    field={f[:download_auto_subs]}
    type="toggle"
    label="Download Autogenerated Subtitles"
    help="Prefers normal subs but will download autogenerated if needed"
  />
  <.input
    field={f[:embed_subs]}
    type="toggle"
    label="Embed Subtitles"
    help="Embeds subtitles in the video file itself, if supported (recommended)"
  />
  <.input
    field={f[:sub_langs]}
    type="text"
    label="Subtitle Languages"
    help="Use commas for multiple languages (eg: en,de)"
  />

  <h3 class="mt-8 text-2xl text-black dark:text-white">
    Thumbnail Options
  </h3>
  <.input
    field={f[:download_thumbnail]}
    type="toggle"
    label="Download Thumbnail"
    help="Downloads thumbnail alongside media file"
  />
  <.input
    field={f[:embed_thumbnail]}
    type="toggle"
    label="Embed Thumbnail"
    help="Embeds thumbnail in the video file itself, if supported (recommended)"
  />

  <h3 class="mt-8 text-2xl text-black dark:text-white">
    Metadata Options
  </h3>
  <.input
    field={f[:download_metadata]}
    type="toggle"
    label="Download Metadata"
    help="Downloads metadata file alongside media file"
  />
  <.input
    field={f[:embed_metadata]}
    type="toggle"
    label="Embed Metadata"
    help="Embeds metadata in the video file itself, if supported (recommended)"
  />

  <h3 class="mt-8 text-2xl text-black dark:text-white">
    Release Format Options
  </h3>

  <.input
    field={f[:shorts_behaviour]}
    options={friendly_format_type_options()}
    type="select"
    label="Include Shorts?"
    help="Experimental. Please report any issues on GitHub"
  />
  <.input
    field={f[:livestream_behaviour]}
    options={friendly_format_type_options()}
    type="select"
    label="Include Livestreams?"
  />

  <h3 class="mt-8 text-2xl text-black dark:text-white">
    Quality Options
  </h3>

  <.input
    field={f[:preferred_resolution]}
    options={friendly_resolution_options()}
    type="select"
    label="Preferred Resolution"
    help="Will grab the closest available resolution if your preferred is not available"
  />

  <.button class="my-10 sm:mb-7.5 w-full sm:w-auto">Save Media profile</.button>

  <div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">
    <.output_template_help />
  </div>
</.simple_form>
