2025-10-22 00:16:32 +07:00
|
|
|
<script setup lang="ts">
|
2025-10-23 03:27:02 +07:00
|
|
|
import { ref } from 'vue'
|
2025-10-24 22:49:46 +07:00
|
|
|
import { ImportWalletComponent, OpenWalletComponent } from '.'
|
2025-10-22 00:16:32 +07:00
|
|
|
|
2025-10-23 03:27:02 +07:00
|
|
|
const emit = defineEmits<{ goToCreate: [] }>()
|
|
|
|
|
|
|
|
|
|
const stage = ref<'import' | 'password'>('import')
|
|
|
|
|
const importData = ref<any>(null)
|
|
|
|
|
|
|
|
|
|
const handleImported = (payload: {
|
|
|
|
|
type: 'seed' | 'privatekey'
|
|
|
|
|
value: string | string[]
|
|
|
|
|
passphrase?: string
|
|
|
|
|
}) => {
|
|
|
|
|
importData.value = payload
|
|
|
|
|
stage.value = 'password'
|
|
|
|
|
}
|
2025-10-22 00:16:32 +07:00
|
|
|
|
|
|
|
|
const handleNavigateToCreate = () => {
|
|
|
|
|
emit('goToCreate')
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="login-tab">
|
2025-10-23 03:27:02 +07:00
|
|
|
<ImportWalletComponent v-if="stage === 'import'" @import-success="handleImported" />
|
|
|
|
|
<OpenWalletComponent v-else @navigateToCreate="handleNavigateToCreate" />
|
2025-10-22 00:16:32 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.login-tab {
|
|
|
|
|
padding: var(--spacing-lg);
|
|
|
|
|
}
|
|
|
|
|
</style>
|