import { Link } from "react-router-dom";
import { ItemProps } from ".";

const MenuSubItem = (props: ItemProps) => {
  if (props.displayType === "IMAGE") {
    return (
      <img
        alt="No Image"
        src={props.label}
        onClick={() => props.onNavigate(props.path, props.navigationType)}
      />
    );
  }

  return (
    <p onClick={() => props.onNavigate(props.path, props.navigationType)}>
      <Link to={props.path}>{props.label}</Link>
    </p>
  );
};
export default MenuSubItem;
