Refactor admin settings, add all service settings
This commit is contained in:
13
app/components/form_elements/fieldset_component.html.erb
Normal file
13
app/components/form_elements/fieldset_component.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= tag.public_send(@tag, class: "mb-6 last:mb-0") do %>
|
||||
<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>
|
||||
<% end %>
|
||||
11
app/components/form_elements/fieldset_component.rb
Normal file
11
app/components/form_elements/fieldset_component.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module FormElements
|
||||
class FieldsetComponent < ViewComponent::Base
|
||||
def initialize(tag: "div", title:, description: nil)
|
||||
@tag = tag
|
||||
@title = title
|
||||
@descripton = description
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user