import { MinusOutlined } from "@ant-design/icons"; import { Button, Grid, InputNumber, Popconfirm } from "antd"; import DeleteIcon from "components/Icons/DeleteIcon"; import PlusIcon from "components/Icons/PlusIcon"; import { useTranslation } from "react-i18next"; import { useAppSelector } from "redux/hooks"; import { colors } from "../../ThemeConstants"; import styles from "./ActionsButtons.module.css"; const { useBreakpoint } = Grid; export default function ActionsButtons({ quantity, setQuantity, max, min, }: { quantity: number; setQuantity: (quantity: number) => void; max?: number; min?: number; }) { const { t } = useTranslation(); const { xs } = useBreakpoint(); // Default to desktop const { isRTL } = useAppSelector((state) => state.locale); // Default to LTR const getPopconfirmOverlayStyle = () => ({ width: xs ? "280px" : "auto", maxWidth: "320px", ".antPopconfirmMessageTitle": { fontSize: xs ? "14px" : "16px", paddingRight: xs ? "24px" : "0", }, ".antPopconfirmMessageContent": { fontSize: xs ? "13px" : "14px", marginTop: "4px", }, ".antPopconfirmButtons": { marginTop: "12px", ".ant-btn": { fontSize: xs ? "13px" : "14px", height: xs ? "28px" : "32px", padding: xs ? "0 12px" : "4px 15px", }, }, }); return (
{quantity > 0 ? ( ) : ( setQuantity(0)} okText={t("cart.deleteConfirmation.confirm")} cancelText={t("cart.deleteConfirmation.cancel")} okButtonProps={{ danger: true }} placement={isRTL ? "left" : "right"} styles={{ root: getPopconfirmOverlayStyle(), body: { padding: xs ? "12px" : "16px", }, }} >
); }