| 1234567891011121314151617181920212223242526 |
- import { IS_GUEST } from "@utils/constants";
- import { getCookie } from "@utils/cookie-tools";
- import { useRouter } from "next/navigation";
- export const ReviewButton = ({ setShowForm, className }: { setShowForm: () => void, className?: string }) => {
- const IsGuest = getCookie(IS_GUEST);
- const router = useRouter();
- const handleAddReview = () => {
- if (IsGuest === "true" || IsGuest === null) {
- setShowForm();
- // router.push("/customer/login");
- } else {
- setShowForm();
- }
- };
- return (
- <button
- onClick={handleAddReview}
- className={`relative flex font-normal text-ly-14 leading-ly-24 text-[#1E3932FF] py-1 px-3.5 cursor-pointer h-fit items-center justify-center rounded-full bg-[#E1E8E6FF] p-4 tracking-wide mt-4 ${className}`}
- >
- Write a review
- </button>
- )
- }
|