Sha256: 17e352bc402b63834a0df4fc8d90b66d69d5b749c5f877e082b87151e7deeb50
Contents?: true
Size: 855 Bytes
Versions: 12
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true module Alchemy module Admin module LinkDialog class Tabs < ViewComponent::Base erb_template <<~ERB <sl-tab-group id="overlay_tabs"> <% tabs.each do |tab| %> <%= render tab.new(@url, is_selected: is_selected?(tab), link_title: @link_title, link_target: @link_target) %> <% end %> </sl-tab-group> ERB def initialize(**options) options.symbolize_keys! @url = options[:url] @selected_tab = options[:selected_tab] @link_title = options[:link_title] @link_target = options[:link_target] end def is_selected?(tab) @selected_tab&.to_sym == tab.panel_name end def tabs Alchemy.link_dialog_tabs end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems