<script>
	export let closable = true;
	export let show = false;
</script>

<div class="pre-header padding-y-xs" style="{show ? '' : 'display:none'}">
    <div class="container max-width-lg position-relative">
        <div class="text-component text-sm padding-right-lg">
            <p>
                <slot/>
            </p>
        </div>
        {#if closable}
            <button class="reset pre-header__close-btn"
                    on:click={(event) => event.target.closest(".pre-header")?.remove()}>
                <svg class="icon"
                     viewBox="0 0 20 20">
                    <title>Close header banner</title>
                    <g fill="none"
                       stroke="currentColor"
                       stroke-linecap="round"
                       stroke-linejoin="round"
                       stroke-width="2">
                        <line x1="4"
                              y1="4"
                              x2="16"
                              y2="16"/>
                        <line x1="16"
                              y1="4"
                              x2="4"
                              y2="16"/>
                    </g>
                </svg>
            </button>
        {/if}
    </div>
</div>
