import { Image, ImageStyle, StyleProp } from "react-native";
import { ImageName } from "../App/common/constants/StringConstant";

export const AppImage: React.FC<AppImageProps> = ({ imageCode, style }) => {
  switch (imageCode) {
    case ImageName.SWW:
      return (
        <Image source={require("../assets/images/sww.png")} style={style} />
      );
    case ImageName.NO_INTERNET:
      return (
        <Image
          source={require("../assets/images/no_internet.png")}
          style={style}
        />
      );
    case ImageName.CROSS:
      return (
        <Image source={require("../assets/images/cross.png")} style={style} />
      );
    case ImageName.HELP:
      return (
        <Image source={require("../assets/images/help.png")} style={style} />
      );
    case ImageName.QUOTE_APOLOGY_ICON:
      return (
        <Image
          source={require("../assets/images/quote_apology_icon.png")}
          style={style}
        />
      );
    case ImageName.BACK_ARROW:
      return (
        <Image
          source={require("../assets/images/arrow_left.png")}
          style={style}
        />
      );
    default:
      return null;
  }
};

interface AppImageProps {
  imageCode?: string;
  style?: StyleProp<ImageStyle>;
}
