<script setup lang="ts">
import { ref, computed } from 'vue'
import { DsStepper, type WizardStep } from '@/components/ui/ds-stepper'
const currentStep = ref(0)
const steps = [
{ key: 'repository', label: 'Repository' },
{ key: 'config', label: 'Configuration' },
{ key: 'review', label: 'Review' }
]
const wizardSteps = computed((): WizardStep[] => {
return steps.map((step, index) => ({
id: step.key,
label: step.label,
status: index < currentStep.value
? 'completed'
: index === currentStep.value
? 'current'
: 'pending'
}))
})
function handleStepClick(step: WizardStep, index: number) {
if (step.status === 'completed') {
currentStep.value = index
}
}
</script>
<template>
<div class="flex gap-8">
<DsStepper
:steps="wizardSteps"
interactive
@step-click="handleStepClick"
/>
<div class="flex-1">
<!-- Step content -->
</div>
</div>
</template>