refactor calculation code
- implement fee - centralize the code
This commit is contained in:
@@ -12,6 +12,7 @@ import RestaurantServices from "./RestaurantServices";
|
||||
// Import the Client Component for localStorage handling
|
||||
import Ads1 from "components/Ads/Ads1";
|
||||
import { Loader } from "components/Loader/Loader";
|
||||
import { useRestaurant } from "hooks/useRestaurant";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useGetRestaurantDetailsQuery } from "redux/api/others";
|
||||
import LocalStorageHandler from "../menu/components/LocalStorageHandler";
|
||||
@@ -19,12 +20,12 @@ import LocalStorageHandler from "../menu/components/LocalStorageHandler";
|
||||
export default function RestaurantPage() {
|
||||
const param = useParams();
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
const { data: restaurant, isLoading } = useGetRestaurantDetailsQuery(
|
||||
"595",
|
||||
{
|
||||
skip: !param.id,
|
||||
},
|
||||
);
|
||||
const { data: restaurant, isLoading } = useGetRestaurantDetailsQuery("595", {
|
||||
skip: !param.id,
|
||||
});
|
||||
|
||||
// Automatically load restaurant taxes when restaurant data is available
|
||||
useRestaurant(restaurant);
|
||||
|
||||
if (isLoading) {
|
||||
return <Loader />;
|
||||
|
||||
Reference in New Issue
Block a user