+ <%= form_with(url: conversations_path,
+ data: { turbo_frame: "nav_conversations", controller: "search" },
+ class: "contents",
+ method: :get
+ ) do |form| %>
+
+ <%= form.text_field :query,
+ value: @query,
+ placeholder: "Search",
+ id: "search-input",
+ autofocus: @query.nil? ? false : true,
+ class: %|
+ w-full
+ p-2 py-1
+ border border-gray-200 rounded-lg
+ text-black dark:text-gray-800
+ |,
+ data: {
+ search_target: "input",
+ turbo_permanent: true,
+ action: %|
+ blur->search#unfocus
+ input->search#search
+ %|
+ }
+ %>
+ <%= icon "x-circle",
+ variant: :mini,
+ size: 18,
+ class: "cursor-pointer text-gray-800 absolute right-1 top-1/2 transform -translate-y-1/2",
+ data: { search_target: "clear", action: "click->search#clear" }
+ %>
+
+ <% end %>
+
+
+