import RobotWhite from "assets/common/robotIconLight.png";
import RobotBlack from "assets/common/robotIconDark.png";
import { ImgIcon } from "common/ImgIcon";
import { useThemeType } from "hooks";

interface Props {
  type?: "light" | "dark";
}

export default function RobotIcon(props: Props) {
  const themeType = useThemeType();
  const { type } = props;

  const src = () => {
    if (type) {
      return type === "light" ? RobotWhite : RobotBlack;
    }

    return themeType === "light" ? RobotBlack : RobotWhite;
  };

  return <ImgIcon alt="marketplace" src={src()} />;
}
