import { Box, IconButton, Typography, useMediaQuery, useTheme } from "@mui/material"; import SectionWrapper from "@components/SectionWrapper"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import TotalPrice from "@components/TotalPrice"; import CustomWrapper from "./CustomWrapper"; import { useCart } from "@root/utils/hooks/useCart"; import { useLocation } from "react-router-dom"; import { usePrevLocation } from "@root/utils/hooks/handleCustomBackNavigation"; export default function Cart() { const theme = useTheme(); const upMd = useMediaQuery(theme.breakpoints.up("md")); const isMobile = useMediaQuery(theme.breakpoints.down(550)); const isTablet = useMediaQuery(theme.breakpoints.down(1000)); const cart = useCart(); const location = useLocation(); const totalPriceBeforeDiscounts = cart.priceBeforeDiscounts; const totalPriceAfterDiscounts = cart.priceAfterDiscounts; const handleCustomBackNavigation = usePrevLocation(location); return ( {isMobile && ( )} Корзина {cart.services.map((serviceData, index) => ( ))} ); }