{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

{{page-title "New Variable"}}
<Breadcrumb @crumb={{hash label="New" args=(array "variables.new")}} />

<section class="section">
  <Hds::PageHeader class="variable-title" as |PH|>
    <PH.Title>Create a Variable</PH.Title>
    <PH.Actions>
      <Hds::Form::Toggle::Field
        @value="enable"
        {{keyboard-shortcut 
          label="Toggle View (JSON/List)"
          pattern=(array "j")
          action=(action this.toggleView)
        }}
        checked={{eq this.view "json"}}
        data-test-json-toggle
        {{on "change" (action this.toggleView)}}
      as |F|>
        <F.Label>JSON</F.Label>
      </Hds::Form::Toggle::Field>
    </PH.Actions>
  </Hds::PageHeader>

  <VariableForm
    @model={{this.model}}
    @path={{this.path}}
    @existingVariables={{this.existingVariables}}
    @view={{this.view}}
  />
</section>
