refactor calculation code

- implement fee
- centralize the code
This commit is contained in:
2025-10-27 08:08:22 +03:00
parent 251e7a9369
commit cd49a3756f
13 changed files with 395 additions and 284 deletions

View File

@@ -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 />;