41 |
Cart
42 |
43 |
52 |
53 |
Total: ${total.toFixed(2)}
54 |
55 | {cart.map(({ name, quantity }) => (
56 |
57 |
66 |
67 | ))}
68 | {cart.length === 0 &&
No items in cart
}
69 |
70 |
71 | );
72 | };
73 |
74 | export default CheckoutPanel;
75 |
--------------------------------------------------------------------------------
/main/src/components/RemoteControls/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import List from "@mui/material/List";
3 | import Cached from "@mui/icons-material/Cached";
4 | import Launch from "@mui/icons-material/Launch";
5 | import ListItem from "@mui/material/ListItem";
6 | import Button from "@mui/material/Button";
7 | import TextField from "@mui/material/TextField";
8 | import { useRemotes, STORAGE_KEY } from "../../context/remotes";
9 | import { findRemoteUrl } from "../../utils/remote";
10 |
11 | export const RemoteControls = () => {
12 | const [remotes, updateRemoteUrl] = useRemotes();
13 | const [productsUrl, setProductsUrl] = useState(
14 | findRemoteUrl("PRODUCTS", remotes)
15 | );
16 | const [cartUrl, setCartUrl] = useState(findRemoteUrl("CART", remotes));
17 | const handleProductsChange = (e: React.ChangeEvent