import Icon from "@expo/vector-icons/MaterialCommunityIcons";
import { useContext } from "react";
import { AppContext } from "../../utils";

export default function MyIcon({ style, name, color, size, disabled }) {
  const appContext = useContext(AppContext);

  const iconColor =
    disabled === true
      ? (color = appContext.appTheme.iconDisabled)
      : color === undefined
      ? appContext.appTheme.icon
      : color;

  return <Icon style={style} name={name} color={iconColor} size={size} />;
}
