refactor the use of plain string order types

This commit is contained in:
2025-10-28 13:29:52 +03:00
parent 7aa686166b
commit 1abb63e8bd
16 changed files with 73 additions and 58 deletions

View File

@@ -7,11 +7,12 @@ import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks";
import styles from "../../address/address.module.css";
import { OrderType } from "pages/checkout/hooks/types.ts";
export default function BriefMenu() {
const { tables, items } = useAppSelector(selectCart);
const { t } = useTranslation();
const { orderType } = useAppSelector(selectCart)
const { orderType } = useAppSelector(selectCart);
const menuItems = useMemo(
() =>
@@ -28,23 +29,20 @@ export default function BriefMenu() {
<div>
<ProText className={styles.itemName}>{item.name}</ProText>
<br />
<ArabicPrice
price={item.price}
type="secondary"
/>
<ArabicPrice price={item.price} type="secondary" />
</div>
</div>
</div>
)),
[items]
[items],
);
const cardTitle = useMemo(
() =>
orderType === "dine-in"
orderType === OrderType.DineIn
? t("checkout.table") + " " + tables
: t("checkout.items"),
[orderType, t, tables]
[orderType, t, tables],
);
return (