This commit is contained in:
nospeedlimitindonesia
2024-07-30 06:40:37 +00:00
parent 1bef19f624
commit ab3732fe9d
7 changed files with 61 additions and 26 deletions

View File

@@ -12,7 +12,9 @@ import {
} from "../helpers/transactionHelpers";
export default function Invoice({ sendParam, deviceType }) {
const { shopId } = useParams();
const { shopId, tableId } = useParams();
sendParam({ shopId, tableId });
const location = useLocation(); // Use useLocation hook instead of useSearchParams
const searchParams = new URLSearchParams(location.search); // Pass location.search directly
@@ -20,10 +22,6 @@ export default function Invoice({ sendParam, deviceType }) {
const orderType = searchParams.get("orderType");
const tableNumber = searchParams.get("tableNumber");
useEffect(() => {
sendParam(shopId);
}, [sendParam, shopId]);
const [cartItems, setCartItems] = useState([]);
const [totalPrice, setTotalPrice] = useState(0);
const [isPaymentLoading, setIsPaymentLoading] = useState(false); // State for payment button loading animation