File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ import styles from "./productDetails.module.scss";
1515import { useRouter } from "next/router" ;
1616
1717const ProductDetails : FC < productDetailsProps > = ( { product } ) => {
18- // const router = useRouter();
19- // const locale = router.locale || "en";
2018 const { data : featuredProduct = [ ] } = useQuery ( {
2119 queryKey : [ "featuredProduct" ] ,
2220 queryFn : async ( ) => {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { productInfoProps } from "./productInfo.types";
1010
1111import styles from "./productInfo.module.scss" ;
1212import { useFetchProductData } from "@/utils/hooks/api/useFetchProductData" ;
13+ import { useRouter } from "next/router" ;
1314
1415const ProductInfo : FC < productInfoProps > = ( {
1516 id,
@@ -22,17 +23,16 @@ const ProductInfo: FC<productInfoProps> = ({
2223 const [ selectedOption , setSelectedOption ] = useState <
2324 { id : string ; value : string } [ ]
2425 > ( [ ] ) ;
26+ const router = useRouter ( ) ;
27+ const locale = router . locale || "en" ;
2528 const { addToCart, isLoading } = useCart ( ) ;
2629 const [ quantity , setQuantity ] = useState ( 1 ) ;
2730
28- const {
29- data : productData ,
30- isFetching,
31- isError,
32- } = useFetchProductData ( {
31+ const { data : productData } = useFetchProductData ( {
3332 productId : id ,
3433 selectedOption,
3534 refresh : true ,
35+ locale : locale ,
3636 } ) ;
3737
3838 const handleSelectOption = ( id : string , value : string ) => {
You can’t perform that action at this time.
0 commit comments