% entry, account = @entry, @entry.account %>
<%= render DialogComponent.new(variant: "drawer") do |dialog| %>
<% dialog.with_header do %>
<%= render "valuations/header", entry: @entry %>
<% end %>
<% dialog.with_body do %>
<% dialog.with_section(title: t(".overview"), open: true) do %>
<%= styled_form_with model: entry,
url: entry_path(entry),
class: "space-y-2",
data: { controller: "auto-submit-form" } do |f| %>
<%= f.text_field :name,
label: t(".name_label"),
placeholder: t(".name_placeholder"),
"data-auto-submit-form-target": "auto" %>
<%= f.date_field :date,
label: t(".date_label"),
max: Date.current,
"data-auto-submit-form-target": "auto" %>
<%= f.money_field :amount,
label: t(".amount"),
auto_submit: true,
disable_currency: true %>
<% end %>
<% end %>
<% dialog.with_section(title: t(".details")) do %>
<%= styled_form_with model: entry,
url: entry_path(entry),
class: "space-y-2",
data: { controller: "auto-submit-form" } do |f| %>
<%= f.text_area :notes,
label: t(".note_label"),
placeholder: t(".note_placeholder"),
rows: 5,
"data-auto-submit-form-target": "auto" %>
<% end %>
<% end %>
<% dialog.with_section(title: t(".settings")) do %>
<%= t(".delete_title") %>
<%= t(".delete_subtitle") %>
<%= button_to t(".delete"),
entry_path(entry),
method: :delete,
class: "rounded-lg px-3 py-2 text-red-500 text-sm font-medium border border-secondary",
data: { turbo_confirm: true, turbo_frame: "_top" } %>
<% end %>
<% end %>
<% end %>