{{#if theme}}
  <div class="t-{{theme}}">
{{/if}}

<form id="{{id}}" class="c-form" action="{{action}}">
  <div class="c-form__global-error" hidden>{{globalError}}</div>
  <fieldset class="c-form__fieldset">
    <legend class="c-form__legend">{{legend}}</legend>
    {{#each fields}}
      {{#ifCond @key "==" "text"}}
        {{> form-field-text this}}
      {{/ifCond}}
      {{#ifCond @key "==" "textarea"}}
        {{> form-field-textarea this}}
      {{/ifCond}}
      {{#ifCond @key "==" "search"}}
        {{> form-field-search this}}
      {{/ifCond}}
      {{#ifCond @key "==" "select"}}
        {{> form-field-select this}}
      {{/ifCond}}
      {{#ifCond @key "==" "checkbox"}}
        {{> form-field-checkbox this}}
      {{/ifCond}}
      {{#ifCond @key "==" "radios"}}
        {{> form-field-radios this}}
      {{/ifCond}}
      {{#ifCond @key "==" "submit"}}
        {{> form-field-button this}}
      {{/ifCond}}
    {{/each}}
  </fieldset>
</form>

{{#if theme}}
  </div>
{{/if}}
