import { getIsGuest } from "@utils/cookie-tools"; import { useRouter } from "next/navigation"; export const ReviewButton = ({ setShowForm, className }: { setShowForm: (show: boolean) => void, className?: string }) => { const IsGuest = getIsGuest(); const router = useRouter(); const handleAddReview = () => { if (IsGuest) { router.push("/customer/login"); } else { setShowForm(true); } }; return ( ) }