import { useEffect } from "react"
import toast from "react-hot-toast"
export const Redirector = ({ to }: { to: string }) => {
  useEffect(() => {
    window.location.href = to
    window.location.reload()
    toast.success("Redirecting to " + to)
    console.log("Redirecting to " + to)
  }, [])

  return <h1>Redirecting to {to}...</h1>
}
