import { useAuthStore } from 'features/AuthStore'
import { useEffect, useState } from 'react'

export const useNewDevicePopup = () => {
  const { isNewDeviceLogin } = useAuthStore()

  const [isOpen, setIsOpen] = useState(isNewDeviceLogin)

  useEffect(() => {
    setIsOpen(isNewDeviceLogin)
  }, [isNewDeviceLogin])

  const close = () => {
    setIsOpen(false)
  }

  return {
    close,
    isOpen,
    setIsOpen,

  }
}
