module Admin::Components::TabHelper
  #
  # <%= render_tab do |context| %>
  #   <% context.set_main do %>
  #	    <li><a href="#">Tab1</a></li>
  #	    <li class="active"><a href="#">Tab2</a></li>
  #	    <li><a href="#">Tab3</a></li>
  #   <% end %>
  #
  #   <% context.set_secondary do %>
  #	    <a href="#">More</a>
  #   <% end %>
  # <% end %>
  #
  def render_tab
    vcontext = ViewContext.new(self)
    html_partial = <<-HTML
  	<div class="px-4 flex items-center justify-between border-b-2 border-gray-400">
  		<ul class="tab px-4">
				#{yield vcontext}
				#{vcontext.main}
  		</ul>
			#{vcontext.secondary}
		</div>
    HTML
    html_partial.html_safe
  end
end
