<script setup lang="ts">
import { ImportWalletComponent } from '.'
import { useRouter } from 'vue-router'

const router = useRouter()

const handleImported = (payload: { type: 'seed' | 'keystore'; value: string | string[] }) => {
    if (payload.type === 'keystore') {
        localStorage.setItem('temp_keystore', JSON.stringify(payload.value))
        return router.push({ name: 'password' })
    }
}
</script>
<template>
    <div class="login-tab">
        <ImportWalletComponent @import-success="handleImported" />
    </div>
</template>
<style lang="scss" scoped>
.login-tab {
    padding: var(--spacing-lg);
}
</style>
