{# LIBRARIES #}
{{ attach_library('ui_patterns/tm_bits_hotlink.tm_bits_hotlink_lib') }}

{% set link_attributes = create_attribute()
  .setAttribute("data-bs-toggle", "collapse")
  .setAttribute('tabindex', '0')
  .setAttribute("data-bs-target", "#shrc-#{ lid }")
  .setAttribute("id", "shrt-#{ lid }")
%}
{% include "@atoms/tm-links/standard/standard.twig" with {
  "text": "<i class='fas fa-share-alt'></i> "~ button_text,
  "url": '#',
  "class": "btn-outline-default btn-sm btn",
  "attributes": link_attributes,
} only %}

{% set content_attributes = create_attribute()
  .setAttribute("aria-labelledby", "shrt-#{ lid }")
  .setAttribute("aria-expanded", "false")
  .setAttribute("id", "shrc-#{ lid }")
%}
<div {{ content_attributes.addClass('collapse') }}>
  <div>
    <label for="shri-{{ lid }}" class="visually-hidden">Share link</label>
    <input name="shri-{{ lid }}" id="shri-{{ lid }}" type="text" class="mb-2 form-control form-text" value="{{ url }}">
  </div>
</div>
