import AddMarkerWhite from "assets/products/Ag/addMarkerWhite.png";
import AddMarkerBlack from "assets/products/Ag/addMarkerBlack.png";
import { ImgIcon } from "common/ImgIcon";
import { useThemeType } from "hooks";
import React from "react";

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

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

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

    return themeType === "light" ? AddMarkerBlack : AddMarkerWhite;
  };

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