<section id="settings">
  <h1>
    <a href="/">{% include('icons/arrow-left.svg') %}</a>
    Settings
  </h1>
  
  {% if updated %}
  <p class="alert">
    <code>{{updated}}</code> 
    {% include('icons/check-circle-solid.svg') %} Settings Updated!
  </p>
  {% endif %}
  
  <form action="/save_settings" method="post">
    <label>
      <small>OPENAI API KEY*</small>
      <input type="password" name="api_key" value="{{current['api_key']}}" required>
    </label>
    <label>
      <small>MODEL NAME*</small>
      <input type="text" name="api_model" value="{{current['api_model']}}" required>
    </label>
    <label>
      <small>OPENAI API ENDPOINT (Leave blank to use default)</small>
      <input type="text" name="api_endpoint" value="{{current['api_endpoint']}}">
    </label>
    <label>
      <small>REASONING EFFORT</small>
      <select name="reasoning_effort">
        <option value="none" {% if current['reasoning_effort']=='none' %}selected{% endif %}>
          none
        </option>
        <option value="low" {% if current['reasoning_effort']=='low' %}selected{% endif %}>
          low
        </option>
        <option value="medium" {% if current['reasoning_effort']=='medium' %}selected{% endif %}>
          medium
        </option>
        <option value="high" {% if current['reasoning_effort']=='high' %}selected{% endif %}>
          high
        </option>
      </select>
    </label>
    <label>
      <small>SYSTEM PROMPT</small>
      <textarea name="system_prompt" class="large" required>{{current['system_prompt']}}</textarea>
    </label>
    <button>{% include('icons/floppy-disk.svg') %} Save</button>
  </form>
</section>
