'use client'

import React, { useState } from 'react'
import Image from 'next/image'

const EmailHandler = () => {
  const [email, setEmail] = useState('')

  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    setEmail(e.target.value)
  }

  return (
    <div className="relative w-full">
      <input
        type="email"
        value={email}
        onChange={handleChange}
        name="email"
        placeholder="Введите ваш e-mail"
        className="w-full px-4 py-3 rounded-md bg-white text-black placeholder:text-gray-400"
      />
      <button className="absolute right-0 top-1/2 -translate-y-1/2  flex items-center justify-center cursor-pointer">
        <Image
          src="/images/subscribe.png"
          alt="submit"
          width={50}
          height={50}
          className="rounded-md"
        />
      </button>
    </div>
  )
}

export default EmailHandler
