Skip to content

Commit

Permalink
Fix component preview
Browse files Browse the repository at this point in the history
  • Loading branch information
malchua committed Dec 20, 2024
1 parent a06c283 commit f990196
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class ViralFormPrefixedSelectComponentPreview < ViewComponent::Preview
class ViralFormPrefixedSelect2ComponentPreview < ViewComponent::Preview
def default; end
end
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<%= form_with(url: "", data: {controller: "viral--select2"}) do |form| %>
<%= viral_prefixed_select2(form:, name: :user) do |select| %>
<% (1..50).each do |num| %>
<% select.with_option(
primary: "User #{num}",
secondary: "Another fact goes here",
value: num,
) %>
<%= select.with_empty_state do %>
No users found
<div class="flex items-center whitespace-nowrap">
<%= viral_prefixed_select2(form:, name: :user, selected_value: 1, placeholder: 'Select User') do |select| %>
<% (1..50).each do |num| %>
<% select.with_option(
primary: "User #{num}",
secondary: "Another fact goes here",
value: num,
) %>
<%= select.with_empty_state do %>
No users found
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<%= form.submit "Submit",
class: "button button--size-default button--state-primary",
disabled: true,
Expand Down

0 comments on commit f990196

Please sign in to comment.