<h1><a href="/admin/table/{{ .Table }}/">&laquo;</a>Admin {{ .Table }}</h1>

<block x-data="{item: {}}"
       x-init="item = await GetJson('/api/admin/new/table/{{ .Table }}')">

  <form method="POST" action="/api/admin/new/table/{{ .Table }}">
    <card>
    <top><h2>New {{ .Table }}</h2></top>

    <middle>
      <template x-for="(value, key) in item">
        <div>
          <label x-text="key" x-bind:for="key"></label>
          <input x-bind:name="key" x-text="value" x-model="item[key]" x-bind:id="key" />
        </div>
      </template>
    </middle>

    <bottom>
      <button type="button"><a href="/admin/table/{{ .Table }}/">Back</a></button>
      <button class="hover:btn-alert" type="button">Clear</button>
      <button class="hover:btn-hover" type="submit">Insert</button>
    </bottom>
    </card>
  </form>
</block>
