|
24 | 24 | variant = ipod_product.image.variant(resize_to_fill: [300, 300]) |
25 | 25 | main_app.url_for(variant) |
26 | 26 | end |
27 | | -%> |
| 27 | + |
| 28 | + simulated_actions = capture do %> |
| 29 | + <div> |
| 30 | + <%= link_to "#", class: "flex items-center gap-2" do %> |
| 31 | + <%= svg("tabler/outline/pencil", class: "h-6") %> |
| 32 | + Edit |
| 33 | + <% end %> |
| 34 | + <%= link_to "#", class: "flex items-center gap-2" do %> |
| 35 | + <%= svg("tabler/outline/eye", class: "h-6") %> |
| 36 | + View |
| 37 | + <% end %> |
| 38 | + <%= link_to "#", class: "flex items-center gap-2" do %> |
| 39 | + <%= svg("tabler/outline/trash", class: "h-6") %> |
| 40 | + Delete |
| 41 | + <% end %> |
| 42 | + </div> |
| 43 | +<% end %> |
28 | 44 | <div class="p-8 bg-white"> |
29 | 45 | <h3 class="text-lg font-semibold text-gray-900 mb-6">Mixed Cases - 8 Items</h3> |
30 | 46 | <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4"> |
|
34 | 50 | badge_label: "New", |
35 | 51 | badge_color: :success, |
36 | 52 | image: nil, |
37 | | - checkbox_checked: false |
| 53 | + checkbox_checked: false, |
| 54 | + actions: simulated_actions, |
38 | 55 | ) %> |
39 | 56 | <%= render Avo::UI::GridItemComponent.new( |
40 | 57 | title: "iPhone", |
41 | 58 | description: "A magical new way to interact", |
42 | 59 | badge_label: "Updated", |
43 | 60 | badge_color: :warning, |
44 | 61 | image: iphone_image, |
45 | | - checkbox_checked: false |
| 62 | + checkbox_checked: false, |
| 63 | + actions: simulated_actions, |
46 | 64 | ) %> |
47 | 65 | <%= render Avo::UI::GridItemComponent.new( |
48 | 66 | title: "Apple watch", |
49 | 67 | description: "A healthy leap ahead", |
50 | | - badge_label: nil, |
51 | | - badge_color: :blue, |
52 | 68 | image: watch_image, |
53 | | - checkbox_checked: false |
| 69 | + checkbox_checked: false, |
| 70 | + actions: simulated_actions, |
54 | 71 | ) %> |
55 | 72 | <%= render Avo::UI::GridItemComponent.new( |
56 | 73 | title: "iPod", |
57 | | - description: nil, |
58 | 74 | badge_label: "Sale", |
59 | 75 | badge_color: :danger, |
60 | 76 | image: ipod_image, |
61 | | - checkbox_checked: false |
| 77 | + checkbox_checked: false, |
| 78 | + actions: simulated_actions, |
62 | 79 | ) %> |
63 | 80 | <%= render Avo::UI::GridItemComponent.new( |
64 | 81 | title: nil, |
65 | 82 | description: "Item without title", |
66 | 83 | badge_label: "Featured", |
67 | 84 | badge_color: :purple, |
68 | 85 | image: macbook_image, |
69 | | - checkbox_checked: false |
| 86 | + checkbox_checked: false, |
| 87 | + actions: simulated_actions, |
70 | 88 | ) %> |
71 | 89 | <%= render Avo::UI::GridItemComponent.new( |
72 | 90 | title: "No Description", |
73 | | - description: nil, |
74 | 91 | badge_label: "Info", |
75 | 92 | badge_color: :info, |
76 | 93 | image: iphone_image, |
77 | | - checkbox_checked: false |
| 94 | + checkbox_checked: false, |
| 95 | + actions: simulated_actions, |
78 | 96 | ) %> |
79 | 97 | <%= render Avo::UI::GridItemComponent.new( |
80 | 98 | title: "No Badge Item", |
81 | 99 | description: "This item has no badge", |
82 | | - badge_label: nil, |
83 | | - badge_color: :blue, |
84 | 100 | image: watch_image, |
85 | | - checkbox_checked: false |
| 101 | + checkbox_checked: false, |
| 102 | + actions: simulated_actions, |
86 | 103 | ) %> |
87 | 104 | <%= render Avo::UI::GridItemComponent.new( |
88 | 105 | title: "Minimal Item", |
89 | | - description: nil, |
90 | | - badge_label: nil, |
91 | | - badge_color: :blue, |
92 | 106 | image: ipod_image, |
93 | | - checkbox_checked: false |
| 107 | + checkbox_checked: false, |
| 108 | + actions: simulated_actions, |
94 | 109 | ) %> |
95 | 110 | </div> |
96 | 111 | </div> |
0 commit comments