mirror of
https://github.com/appwrite/console.git
synced 2026-04-07 19:17:46 +00:00
39 lines
1.0 KiB
Svelte
39 lines
1.0 KiB
Svelte
<script lang="ts">
|
|
import { createEventDispatcher } from 'svelte';
|
|
import Step from './step.svelte';
|
|
|
|
export let steps: {
|
|
text: string;
|
|
optional: boolean;
|
|
disabled?: boolean;
|
|
substeps?: {
|
|
text: string;
|
|
}[];
|
|
}[];
|
|
export let currentStep = 1;
|
|
export let currentSub = 1;
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
$: firstOptional = steps.findIndex((step) => step.optional);
|
|
</script>
|
|
|
|
<ol class="steps">
|
|
{#if steps}
|
|
{#each steps as step, index}
|
|
{@const stepNumber = index + 1}
|
|
{#if firstOptional === index}
|
|
<li class="steps-item">
|
|
<h3 class="eyebrow-heading-3">OPTIONAL</h3>
|
|
</li>
|
|
{/if}
|
|
<Step
|
|
on:click={() => dispatch('step', stepNumber)}
|
|
bind:currentSub
|
|
current={currentStep === stepNumber}
|
|
completed={stepNumber < currentStep}
|
|
{step} />
|
|
{/each}
|
|
{/if}
|
|
</ol>
|