<%= turbo_frame_tag dom_id(@workflow, :header) do %>
  <div class="flex align-center gap-half">
    <%= form_with model: @workflow, url: workflow_path(@workflow), id: dom_id(@workflow, :form), class: "full-width", data: { controller: "form" } do |form| %>
      <h3 class="txt-large margin-none">
        <%= form.text_field :name, required: true, autofocus: true, class: "input full-width", style: "--input-padding: 0.2em 0.5em;", data: { action: "keydown.esc@document->form#cancel" } %>
      </h3>
      <%= link_to "Cancel", workflow_path(@workflow), data: { form_target: "cancel", turbo_frame: dom_id(@workflow) }, hidden: true %>
    <% end %>

    <%= tag.button type: :submit, class: "btn txt-small btn--positive", form: dom_id(@workflow, :form) do %>
      <%= icon_tag "check" %>
      <span class="for-screen-reader">Save</span>
    <% end %>

    <%= link_to workflow_path(@workflow), class: "btn txt-small", data: { turbo_frame: dom_id(@workflow) } do %>
      <%= icon_tag "remove-med" %>
      <span class="for-screen-reader">Cancel</span>
    <% end %>

    <%= button_to workflow_path(@workflow), method: :delete, class: "btn txt-small btn--negative", data: { turbo_frame: :workflows, turbo_confirm: "Are you sure you want to delete this workflow?" } do %>
      <%= icon_tag "minus" %>
      <span class="for-screen-reader">Delete <%= @workflow.name %></span>
    <% end %>
  </div>
<% end %>
