'use client'; import { useState } from 'react'; import Modal from './ui/Modal'; interface PasswordModalProps { isOpen: boolean; onClose: () => void; onSubmit: (password: string) => void; isLoading: boolean; } export default function PasswordModal({ isOpen, onClose, onSubmit, isLoading }: PasswordModalProps) { const [password, setPassword] = useState(''); const [passwordError, setPasswordError] = useState(''); const [showPassword, setShowPassword] = useState(false); const handleSubmit = () => { setPasswordError(''); if (!password.trim()) { setPasswordError('Please enter a password'); return; } if (password.length < 4) { setPasswordError('Password must be at least 4 characters'); return; } onSubmit(password); }; const handleClose = () => { setPassword(''); setPasswordError(''); setShowPassword(false); onClose(); }; const passwordIcon = ( ); return (

Add a passcode for extra privacy

Anyone accessing this clipboard will need the code you choose.

{ setPassword(e.target.value); if (passwordError) setPasswordError(''); }} placeholder="Create a passcode" className="w-full pl-10 pr-12 py-3 rounded-lg bg-surface/80 border border-surface-hover focus:border-primary focus:ring-4 focus:ring-primary/20 focus:outline-none transition-colors duration-300 ease-in-out text-text-primary placeholder-text-secondary/50 font-mono shadow-inner" autoFocus autoComplete="off" />
4+ At least 4 characters
Mix letters & numbers
{passwordError && (
{passwordError}
)}
); }