import JohnDeereLogoWhite from "assets/marketplaceImages/JDWhite.png";
import JohnDeereLogoBlack from "assets/marketplaceImages/JDBlack.png";
import { ImgIcon } from "common/ImgIcon";
import { useThemeType } from "hooks";
import React from "react";

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

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

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

    return themeType === "light" ? JohnDeereLogoBlack : JohnDeereLogoWhite;
  };

  return <ImgIcon alt="john-deere" src={src()} />;
}
