import { useLoaderData, Form, useActionData } from "react-router-dom"; import { CartPlusFill } from "react-bootstrap-icons" import { InfoModal } from "../../components/info_modal"; import { Modal } from "flowbite"; import { isUserAuthenticated } from "../../lib/session"; import ProductListing from "../../components/product_listing"; import MainContentLayout from "../../components/main_content_layout"; import Review from "../../components/review"; import ReviewForm from "../../components/forms/review_form"; import "../../components/stylesheets/shared.css" import { useEffect } from "react"; export default function Product() { let quantity_field; let review_form_error_messages; const response = useLoaderData(); const action_response = useActionData(); const product = response[0].data; const reviews = response[1].data.data.map(review =>