import { EncryptedText } from '@/components/encrypted-text'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { filterTransactionalAccounts, type Account } from '@/types/account'; import type { UUID } from '@/types/uuid'; import { Building2 } from 'lucide-react'; import { useEffect } from 'react'; interface ImportStepAccountProps { accounts?: Account[]; selectedAccountId: UUID | null; onAccountSelect: (accountId: UUID) => void; onNext: () => void; } export function ImportStepAccount({ accounts: rawAccounts = [], selectedAccountId, onAccountSelect, onNext, }: ImportStepAccountProps) { const accounts = filterTransactionalAccounts(rawAccounts); // If there is only one account, auto-select it, and proceed to next step useEffect(() => { if (accounts.length === 1) { onAccountSelect(accounts[0].id); onNext(); } }, [accounts, onAccountSelect, onNext]); if (accounts.length === 0) { return (
No accounts found. Please create an account first.