2023-01-03 09:26:08 +01:00
|
|
|
<script>
|
|
|
|
|
import TextChip from '../Chip/Text.svelte';
|
|
|
|
|
|
|
|
|
|
export let size;
|
|
|
|
|
export let hasDivider = false;
|
|
|
|
|
export let active = false;
|
|
|
|
|
export let avatarText = '';
|
|
|
|
|
export let text = '';
|
|
|
|
|
export let onClick;
|
2023-04-22 20:00:37 +00:00
|
|
|
export let disabled = false;
|
2023-01-03 09:26:08 +01:00
|
|
|
</script>
|
|
|
|
|
|
2023-04-22 20:00:37 +00:00
|
|
|
<div class="relative">
|
|
|
|
|
<button
|
|
|
|
|
class="{disabled &&
|
|
|
|
|
'opacity-25'} flex items-center w-60 py-2 px-3 {hasDivider &&
|
|
|
|
|
'border-b border-gray-100'} {active && 'bg-blue-100'}"
|
|
|
|
|
on:click={onClick}
|
|
|
|
|
>
|
|
|
|
|
{#if avatarText}
|
|
|
|
|
<TextChip
|
|
|
|
|
value={avatarText}
|
|
|
|
|
className="mr-2 bg-blue-200 font-bold"
|
|
|
|
|
{size}
|
|
|
|
|
/>
|
|
|
|
|
{/if}
|
|
|
|
|
{text}
|
|
|
|
|
</button>
|
|
|
|
|
{#if disabled}
|
|
|
|
|
<div class="coming-soon">
|
|
|
|
|
<TextChip value="Coming soon" className="text-xs" />
|
|
|
|
|
</div>
|
2023-01-03 09:26:08 +01:00
|
|
|
{/if}
|
2023-04-22 20:00:37 +00:00
|
|
|
</div>
|
2023-01-03 09:26:08 +01:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
button {
|
|
|
|
|
min-height: 56px;
|
|
|
|
|
}
|
2023-04-22 20:00:37 +00:00
|
|
|
|
|
|
|
|
.coming-soon {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 5px;
|
|
|
|
|
right: 5px;
|
|
|
|
|
}
|
2023-01-03 09:26:08 +01:00
|
|
|
</style>
|