<%# Wenn dem Partial keine feste URL übergeben wurde, nutzt es automatisch die aktuelle Browser-URL %> <% form_url = local_assigns[:url] || request.fullpath %> <%= form_with(url: form_url, method: :get, data: { controller: "search-form", turbo_frame: "items_list_frame" }, class: "w-full bg-white border border-gray-200 rounded-xl shadow-sm p-4 bg-gray-50 flex flex-col sm:flex-row gap-3 justify-between items-center mb-6") do |form| %>
<%= form.text_field :query, value: params[:query], placeholder: "Artikel, SKU, SN oder ID...", data: { action: "input->search-form#submit", scanner_target: "input" }, class: "py-2 px-3 pl-9 pr-10 block w-full border border-gray-300 rounded-lg text-sm bg-white focus:border-blue-500 focus:ring-blue-500" %>
<% if local_assigns[:show_csv] %> <%= link_to items_path(format: :csv), class: "py-2 px-3 border border-gray-300 rounded-lg text-sm font-medium bg-white text-gray-700 hover:bg-gray-50 flex items-center gap-1.5 transition shadow-sm", title: "Liste als Excel/CSV exportieren" do %> CSV <% end %> <% end %>
<% end %>