func Pages.Settings(tytd,ctx)
{
    var totalSecs = tytd.Config.BellTimer ?? 10800;
    var enablePlugins = tytd.Config.EnablePlugins ?? true;
    var hours = totalSecs / 3600;
    totalSecs -= hours * 3600;
    var minutes = totalSecs / 60;
    var seconds = totalSecs % 60;


    var html = <form hx-post="./settings" hx-target="body" >
                <div class="field middle-align">
  <nav>
    <div class="max">
      <h6>Enable plugins</h6>
      <div>Plugins allow you to extend tytd, but they have full access</div>
    </div>
    <label class="switch">
      <if(enablePlugins)>
        <true>
            <input name="enablePlugins" type="checkbox" checked>
        </true>
        <false>
            <input name="enablePlugins" type="checkbox">
        </false>
      </if>
      <span></span>
    </label>
  </nav>
</div>
        <div class="field label border">
            <input type="text" name="tag" value={tytd.TYTDTag}>
            <label>TYTD Tag</label>
        </div>

        <fieldset>
            <legend>Subscriber Poll Rate</legend>
            <div class="row">
                <div class="max">
                    <div class="field label border">
                        <input type="number" name="hours" value={hours}>
                        <label>Hours</label>
                    </div>
                </div>
                <div class="max">
                    <div class="field label border">
                        <input type="number" name="minutes" value={minutes}>
                        <label>Minutes</label>
                    </div>
                </div>
                <div class="max">
                    <div class="field label border">
                        <input type="number" name="seconds" value={seconds}>
                        <label>Seconds</label>    
                    </div>
                </div>
            </div>
        </fieldset>
        
        <footer>
            <button>Save</button>
        </footer>
    </form>;

    return Components.Shell("Settings",html ,3);
}