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

  <.input
    field={f[:friendly_name]}
    type="text"
    label="Custom Name"
    help="Something descriptive. Does not impact indexing or downloading"
  />

  <.input field={f[:original_url]} type="text" label="Source URL" help="URL of a channel or playlist (required)" />

  <.input
    field={f[:media_profile_id]}
    options={Enum.map(@media_profiles, &{&1.name, &1.id})}
    type="select"
    label="Media Profile"
  />

  <.input
    field={f[:index_frequency_minutes]}
    options={friendly_index_frequencies()}
    type="select"
    label="Index Frequency"
    help="The time between one index of this source finishing and the next one starting"
  />

  <.input
    field={f[:download_media]}
    type="toggle"
    label="Download Media?"
    help="Unchecking still indexes media but it won't be downloaded until you enable this option"
  />

  <:actions>
    <.button class="mt-15 mb-5 sm:mb-7.5">Save Source</.button>
  </:actions>
</.simple_form>
