%
local_assigns[:margin_bottom] ||= 0
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
text ||= false
nowrap_text ||= false
href ||= false
subtext ||= false
subtext_href ||= false
mobile_subtext ||= false
light_text ||= false
blue_arrow ||= false
white_arrow ||= false
simple ||= false
simple_light ||= false
dark_icon ||= false
small_icon ||= false
nhs_icon ||= false
brexit_icon ||= false
transparent_icon ||= false
data ||= nil
classes ||= nil
font_size ||= nil
css_classes = %w(gem-c-action-link)
css_classes << "gem-c-action-link--light-text" if light_text
css_classes << "gem-c-action-link--dark-icon" if dark_icon
css_classes << "gem-c-action-link--small-icon" if small_icon
css_classes << "gem-c-action-link--transparent-icon" if transparent_icon
css_classes << "gem-c-action-link--nhs" if nhs_icon
css_classes << "gem-c-action-link--brexit" if brexit_icon
css_classes << "gem-c-action-link--blue-arrow" if blue_arrow
css_classes << "gem-c-action-link--white-arrow" if white_arrow
css_classes << "gem-c-action-link--simple" if simple
css_classes << "gem-c-action-link--simple-light" if simple_light
css_classes << "gem-c-action-link--with-subtext" if subtext
css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
css_classes << shared_helper.get_margin_bottom
link_classes = %w(govuk-link gem-c-action-link__link)
link_classes << shared_helper.classes if classes
link_classes << "govuk-link--inverse" if light_text
link_classes << shared_helper.get_heading_size(font_size, 'm') if font_size
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class(css_classes.join(" "))
%>
<% if text.present? %>
<%= tag.div(**component_helper.all_attributes) do %>
<% contents = capture do %>
<% main_text = capture do %>
<%= text %>
<%= content_tag(:span, nowrap_text, class: "gem-c-action-link__nowrap-text") if nowrap_text %>
<% end %>
<% if href.present? %>
<%= link_to href, class: link_classes, data: data do %>
<%= main_text %>
<% end %>
<% else %>
<%= main_text %>
<% end %>
<% if subtext %>
<% if subtext_href %>
<%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
<%= link_to subtext, subtext_href, class: link_classes, data: data %>
<% end %>
<% else %>
<%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
<% end %>
<% end %>
<% end %>
<% if subtext %>
<%= content_tag(:span, contents, class: "gem-c-action-link__contents-wrapper") %>
<% else %>
<%= contents %>
<% end %>
<% end %>
<% end %>