import React, { useMemo } from "react"; import BentoOutlinedIcon from "@mui/icons-material/BentoOutlined"; import HomeWorkOutlinedIcon from "@mui/icons-material/HomeWorkOutlined"; import StorefrontOutlinedIcon from "@mui/icons-material/StorefrontOutlined"; import StoreOutlinedIcon from "@mui/icons-material/StoreOutlined"; import Chip, { ChipProps } from "@mui/material/Chip"; import useTheme from "@mui/material/styles/useTheme"; import { OrderDestinationType, OrderDetail } from "../../types/order"; export interface OrderDestinationChipProps extends ChipProps { element: OrderDetail; } const OrderDestinationChip: React.FC = (props) => { const theme = useTheme(); const { element: { destination_type }, ...rest } = props; const color = useMemo(() => { const colorMap: Record = { HOME: "info", LOCKER: "info", SERVICE_POINT: "info", STORE: "info", }; return colorMap[destination_type]; }, [destination_type, theme]); const label = useMemo(() => { const labelMap: Record = { HOME: "HOME", LOCKER: "LOCKER", SERVICE_POINT: "SERVICE POINT", STORE: "STORE PICKUP", }; return labelMap[destination_type]; }, [destination_type, theme]); const icon = useMemo(() => { const iconMap: Record = { HOME: , LOCKER: , SERVICE_POINT: , STORE: , }; return iconMap[destination_type]; }, [destination_type, theme]); return ( ); }; export default OrderDestinationChip;