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

@@ -14,6 +14,7 @@ import { useTranslation } from "react-i18next";
import { Link, useParams } from "react-router-dom";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import styles from "./restaurant.module.css";
import { OrderType } from "pages/checkout/hooks/types.ts";
interface RestaurantServicesProps {
dineIn?: boolean;
@@ -43,7 +44,7 @@ export default function RestaurantServices({
const services = [
...((dineIn && [
{
id: "dine-in",
id: OrderType.DineIn,
title: t("common.dineIn"),
description: t("home.services.dineIn"),
icon: (
@@ -58,7 +59,7 @@ export default function RestaurantServices({
[]),
...((pickup && [
{
id: "pickup",
id: OrderType.Pickup,
title: t("common.pickup"),
description: t("home.services.pickup"),
icon: (
@@ -73,7 +74,7 @@ export default function RestaurantServices({
[]),
...((gift && [
{
id: "gift",
id: OrderType.Gift,
title: t("common.sendGift"),
description: t("home.services.gift"),
icon: (
@@ -88,7 +89,7 @@ export default function RestaurantServices({
[]),
...((toRoom && [
{
id: "room",
id: OrderType.ToRoom,
title: t("common.roomService"),
description: t("home.services.room"),
icon: (
@@ -101,7 +102,7 @@ export default function RestaurantServices({
[]),
...((toOffice && [
{
id: "office",
id: OrderType.ToOffice,
title: t("common.officeDelivery"),
description: t("home.services.office"),
icon: (
@@ -116,7 +117,7 @@ export default function RestaurantServices({
[]),
...((is_booking_enabled && [
{
id: "booking",
id: OrderType.Booking,
title: t("common.tableBooking"),
description: t("home.services.booking"),
icon: (
@@ -131,7 +132,7 @@ export default function RestaurantServices({
[]),
...((delivery && [
{
id: "delivery",
id: OrderType.Delivery,
title: t("common.delivery"),
description: t("home.services.delivery"),
icon: (