<div class="gh-email-subject">
    {{#if this.isEditing}}
        <input
            aria-label="Email subject"
            type="text"
            class="gh-input gh-preview-email-subject-input"
            placeholder={{truncate @post.title 40}}
            value={{this.subject}}
            {{on "blur" this.setSubject}}
            {{on-key "Enter" this.setSubject}}
            {{autofocus}}
        />
    {{else}}
        <button class="gh-preview-email-subject" type="button" {{on "click" this.editSubject}}>
            {{this.subject}} {{svg-jar "pen"}}
        </button>
    {{/if}}

    <div class="error">
        <GhErrorMessage @errors={{@post.errors}} @property="emailSubject" />
    </div>
</div>
