diff --git a/apps/machine/src/views/CashInView.vue b/apps/machine/src/views/CashInView.vue index 49df04b..3316a2c 100644 --- a/apps/machine/src/views/CashInView.vue +++ b/apps/machine/src/views/CashInView.vue @@ -3,18 +3,32 @@ import { watch, computed, ref } from 'vue' import { useRouter } from 'vue-router' import { useAtmStore } from '@/stores/atm' import { Button } from '@/components/ui/button' -import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Alert, AlertDescription } from '@/components/ui/alert' -import { Skeleton } from '@/components/ui/skeleton' import { Input } from '@/components/ui/input' -import { ScrollArea } from '@/components/ui/scroll-area' import QRCode from '@/components/QRCode.vue' +import BounceDots from '@/components/BounceDots.vue' +import StepIndicator from '@/components/StepIndicator.vue' const router = useRouter() const atmStore = useAtmStore() const isElectron = typeof window !== 'undefined' && window.electronAPI !== undefined +const cashInSteps = ['Insert', 'Scan', 'Done'] + +const currentStepIndex = computed(() => { + switch (nestedState.value) { + case 'fetchingRate': + case 'insertingBills': + return 0 + case 'generatingNdebit': + case 'displayingQR': + return 1 + default: + return 2 + } +}) + // Whether the header cancel button should be visible // State machine routes CANCEL to confirmAbandon when bills are present const showCancelButton = computed(() => { @@ -158,13 +172,8 @@ function simulateBill(denomination: number) { // Convert npub to hex pubkey if needed function normalizePubkey(input: string): string { const trimmed = input.trim() - // If it's an npub, we'd need to decode it - for now just pass through - // In production, use nostr-tools nip19.decode() if (trimmed.startsWith('npub1')) { - // Simple check - in production decode properly console.log('[CashIn] npub detected, would decode in production') - // For now, just return as-is and let the CLINK client handle it - // TODO: Properly decode npub using nostr-tools } return trimmed } @@ -206,76 +215,80 @@ const isProcessing = computed(() => atmStore.isPayingInvoice || atmStore.isReque