{#
component: button
#}
{% set props = {
title: null,
text: null,
to: null,
externe: null,
icon: null,
blank: false,
theme: null,
arrow:false,
size: null,
class:null,
type:"button",
contactButton:false,
bookingLink:null,
rel:"",
aquao:null,
category:"reservation"
}|merge(props|default({})) %}
{# Modifier classes #}
{% set modifierClasses = [] %}
{% if props.theme %}
{% set modifierClasses = modifierClasses|merge(['Button-component--' ~ props.theme ~ '-theme']) %}
{% endif %}
{% if props.size %}
{% set modifierClasses = modifierClasses|merge(['Button-component--' ~ props.size ~ '-size']) %}
{% endif %}
{% if props.class %}
{% set modifierClasses = modifierClasses|merge([' ' ~ props.class ]) %}
{% endif %}
{# Target #}
{% set targetAttributes = '' %}
{% if props.blank %}
{% set targetAttributes = targetAttributes ~ 'target="_blank" rel="no-referrer"' %}
{% endif %}
{% set tag = "button" %}
{% if props.to %}
{% set tag = "a" %}
{% endif %}
<{{tag}} {% if tag != 'a' %} type="{{props.type}}" {% endif %} {% if props.bookingLink %} data-bookinglink="{{ props.bookingLink}}" {% endif %} {% if props.aquao is defined %} data-aquao="{{ props.aquao}}" {% endif %} data-component="button" class="Button-component{{ ' ' ~ modifierClasses | join(' ') }}" {% if props.to %} href="{{ props.to }}" {% endif %} {% if props.to != "#" %} target="{{props.externe}}" {% endif %} data-category="{{props.category}}" title="{{ props.title }}" {{ targetAttributes }} rel="{{ props.rel }}">
{% if props.contactButton %}
{% set schemeAndHttpHost = app.request.getSchemeAndHttpHost %}
{# {% if 'miramar-lacigale.com' in schemeAndHttpHost %}
<!--
Event snippet for [MIRAMAR] - CONTACT on : Please do not remove.
Place this snippet on pages with events you’re tracking.
Creation date: 07/15/2020
-->
<script>
gtag('event', 'conversion', {
'allow_custom_scripts': true,
'send_to': 'DC-10209412/invmedia/miram000+standard'
});
</script>
<noscript>
<img src="https://ad.doubleclick.net/ddm/activity/src=10209412;type=invmedia;cat=miram000;dc_lat=;dc_rdid=;tag_for
_child_directed_treatment=;tfua=;npa=;ord=1?" width="1" height="1" alt=""/>
</noscript>
<!-- End of event snippet: Please do not remove -->
{% endif %} #}
{% endif %}
{% if props.icon %}
{% include "component/svg.html.twig" with {
props: {
name: props.icon
}
} %}
{% endif %}
{% if props.arrow %}
{% include "component/svg.html.twig" with {
props: {
name: 'arrow-down'
}
} %}
{% endif %}
<span class="Button-text">{{ props.text }}</span>
</{{tag}}>