30 lines
890 B
Plaintext
30 lines
890 B
Plaintext
<%= tag.public_send(@tag, class: "mb-6 last:mb-0") do %>
|
|
<% if @positioning == :vertical %>
|
|
<label class="block">
|
|
<p class="font-bold <%= @descripton.present? ? "mb-1" : "mb-2" %>">
|
|
<%= @title %>
|
|
</p>
|
|
<% if @descripton.present? %>
|
|
<p class="text-gray-500">
|
|
<%= @descripton %>
|
|
</p>
|
|
<% end %>
|
|
<%= content %>
|
|
</label>
|
|
<% elsif @positioning == :horizontal %>
|
|
<label class="block flex items-center justify-between">
|
|
<div class="flex flex-col">
|
|
<label class="font-bold mb-1"><%= @title %></label>
|
|
<% if @descripton.present? %>
|
|
<p class="text-gray-500"><%= @descripton %></p>
|
|
<% end %>
|
|
</div>
|
|
<div class="relative ml-4 inline-flex flex-shrink-0">
|
|
<%= content %>
|
|
</div>
|
|
</label>
|
|
<% else %>
|
|
<p>Invalid <code>positioning<code> argument for <code>FieldsetComponent</code>.</p>
|
|
<% end %>
|
|
<% end %>
|