import React from "react";

import AllInboxIconOutlined from "@mui/icons-material/AllInboxOutlined";
import HomeIconOutlined from "@mui/icons-material/HomeOutlined";
import LocalShippingIconOutlined from "@mui/icons-material/LocalShippingOutlined";
import StoreIconOutlined from "@mui/icons-material/StoreOutlined";
import { SvgIconTypeMap } from "@mui/material/SvgIcon";

import { ShipmentDestinationType } from "../types/shipment";

export type ShipmentDestinationIconProps = SvgIconTypeMap["props"] & {
  type: ShipmentDestinationType;
};

export const ShipmentDestinationIcon: React.FC<ShipmentDestinationIconProps> = ({
  type,
  ...props
}) => {
  return {
    HOME: <HomeIconOutlined {...props} />,
    LOCKER: <AllInboxIconOutlined {...props} />,
    SERVICE_POINT: <LocalShippingIconOutlined {...props} />,
    STORE: <StoreIconOutlined {...props} />,
  }[type];
};
