'use client'; import React, { useState } from 'react'; import { Button } from '@/components/ui/button'; import { PassportFilePicker } from './passport-file-picker'; import { CreatePassportDialog } from './create-passport-dialog'; import { ProfileManagementDialog } from './profile-management-dialog'; import { useAuth } from '@/lib/auth/context'; interface LoginButtonProps { className?: string; } export function LoginButton({ className }: LoginButtonProps) { const [showFilePicker, setShowFilePicker] = useState(false); const [showCreatePassport, setShowCreatePassport] = useState(false); const [showProfileManagement, setShowProfileManagement] = useState(false); const [selectedPassportFile, setSelectedPassportFile] = useState(null); const handleFileSelected = async (file: File) => { console.log('File selected:', file.name); setSelectedPassportFile(file); // The passport-file-picker will handle password input and decryption // We just need to close the file picker dialog setShowFilePicker(false); }; const handleCreatePassport = () => { setShowFilePicker(false); setShowCreatePassport(true); }; const handlePassportCreated = () => { // Optional: Show success message or trigger login with the new passport console.log('Passport created successfully'); }; return ( <> {showFilePicker && (

Select Passport File

Don't have a passport yet?

)} ); }