<script>
    export let href = '#'
    export let type = 'a'
    export let text = ''
    export let noScroll = undefined
</script>

{#if type === 'button'}
<button class={$$props.class ? $$props.class : 'button'} on:click>
    <slot></slot>
    <div class="text" data-text={text}>
        <span>{text}</span>
    </div>
</button>

{:else}
<a {href} class={$$props.class ? $$props.class : 'button'} on:click sapper-noscroll={noScroll}>
    <slot></slot>
    <div class="text" data-text={text}>
        <span>{text}</span>
    </div>
</a>
{/if}
