2021-07-17 22:29:12 +03:00
|
|
|
<script>
|
2023-08-10 00:35:45 +01:00
|
|
|
import { Video, Notebook, PresentationFile } from 'carbon-icons-svelte';
|
2021-07-17 22:29:12 +03:00
|
|
|
export let tabs = [];
|
|
|
|
|
export let currentTab;
|
|
|
|
|
export let onChange;
|
|
|
|
|
</script>
|
|
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
<div class="w-full flex flex-col">
|
2023-08-10 00:35:45 +01:00
|
|
|
<div class="flex items-center border-b-2 w-full">
|
2021-07-17 22:29:12 +03:00
|
|
|
{#each tabs as tab}
|
|
|
|
|
<button
|
2023-08-09 16:00:54 +01:00
|
|
|
class="relative {currentTab === tab.value
|
2023-08-10 00:35:45 +01:00
|
|
|
? 'text-blue-500 dark:bg-gray-700'
|
|
|
|
|
: 'dark:bg-gray-500 text-black'} font-semibold focus:outline-none w-16 text-left py-3 mr-10"
|
2021-07-17 22:29:12 +03:00
|
|
|
on:click={onChange(tab.value)}
|
|
|
|
|
>
|
2023-08-10 00:35:45 +01:00
|
|
|
{#if tab.value === 1}
|
|
|
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
|
|
|
<Notebook />
|
|
|
|
|
{tab.label}
|
|
|
|
|
</div>
|
|
|
|
|
{:else if tab.value === 2}
|
|
|
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
|
|
|
<PresentationFile />
|
|
|
|
|
{tab.label}
|
|
|
|
|
</div>
|
|
|
|
|
{:else}
|
|
|
|
|
<div class="grid grid-cols-3 gap-4 items-center">
|
|
|
|
|
<Video />
|
|
|
|
|
{tab.label}
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
<!-- {tab.label} -->
|
2023-08-09 16:00:54 +01:00
|
|
|
<!-- {#if typeof tab.badgeValue === 'number'}
|
2023-08-05 04:44:32 +01:00
|
|
|
<Chip value={tab.badgeValue} className="ml-1 bg-gray-300 dark:text-black" />
|
2023-08-09 16:00:54 +01:00
|
|
|
{/if} -->
|
2021-07-17 22:29:12 +03:00
|
|
|
|
2023-08-10 08:23:22 +01:00
|
|
|
<span
|
2023-08-10 08:47:24 +01:00
|
|
|
class="absolute bottom-0 left-0 h-1 bg-blue-500 rounded-md transition-all ease-in-out duration-500 {currentTab ===
|
2023-08-10 08:23:22 +01:00
|
|
|
tab.value
|
|
|
|
|
? 'w-full'
|
|
|
|
|
: 'w-0'}"
|
|
|
|
|
/>
|
2021-07-17 22:29:12 +03:00
|
|
|
</button>
|
|
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
|
2021-07-25 17:44:11 +03:00
|
|
|
<div class="mt-4">
|
|
|
|
|
<slot name="content" />
|
|
|
|
|
</div>
|
2021-07-17 22:29:12 +03:00
|
|
|
</div>
|