♻️ Moved buttons into own components

This commit is contained in:
Mawoka
2023-01-27 22:25:57 +01:00
parent 0083b1552a
commit 2d05ee26bd
6 changed files with 102 additions and 69 deletions
@@ -0,0 +1,28 @@
<script lang="ts">
export let disabled = false;
export let flex = false;
export let href: undefined | string = undefined;
</script>
{#if href}
<a
{href}
class="w-full px-4 py-2 leading-5 text-black dark:text-white transition-colors duration-200 transform bg-gray-50 dark:bg-gray-700 rounded text-center hover:bg-gray-300 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-gray-600"
on:click
class:flex
class:justify-center={flex}
>
<slot />
</a>
{:else}
<button
{disabled}
class="w-full px-4 py-2 leading-5 text-black dark:text-white transition-colors duration-200 transform bg-gray-50 dark:bg-gray-700 rounded text-center hover:bg-gray-300 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-gray-600"
on:click
class:flex
class:justify-center={flex}
>
<slot />
</button>
{/if}