<script>
    export let href = '#'
    export let type = 'a'
    export let text = ''
</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>
    <slot></slot>
    <div class="text" data-text={text}>
        <span>{text}</span>
    </div>
</a>
{/if}
