import React from 'react';
import type { SvgProps } from 'react-native-svg';
import GiftIcon from '../../assets/svgs/GiftIcon.svg';
import CheckboxFilled from './CheckboxFilled.svg';
import CheckboxEmpty from './CheckboxEmpty.svg';
import FullStar from '../../assets/svgs/FullStar.svg';
import HalfStar from '../../assets/svgs/HalfStar.svg';
import EmptyStar from '../../assets/svgs/EmptyStar.svg';
import HidePassword from '../../assets/svgs/HidePassword.svg';
import ShowPassword from '../../assets/svgs/ShowPassword.svg';
import SelectedRadio from '../../assets/svgs/SelectedRadio.svg';
import UnselectedRadio from '../../assets/svgs/UnselectedRadio.svg';
import Close from '../../assets/svgs/Close.svg';
import DownArrow from '../svgs/DownArrow.svg';
import UpArrow from '../svgs/UpArrow.svg';
import AddIcon from '../svgs/ic_add.svg';
import PencilIcon from '../svgs/pencil.svg';
import CalendarIcon from '../svgs/calendar.svg';
import SuccessIcon from '../svgs/ic_success.svg';
import FailureIcon from '../svgs/ic_failure.svg';
import SearchIcon from '../svgs/ic_search.svg';
import Arabic_SuccessIcon from '../svgs/ic_success_arabic.svg';
import Arabic_FailureIcon from '../svgs/ic_failure_arabic.svg';

//=====Add icon name (your preference) over here and in Switch case
export type IconNames =
  | 'gifticon'
  | 'selectedradio'
  | 'unselectedradio'
  | 'hidepassword'
  | 'showpassword'
  | 'close'
  | 'checkboxfilled'
  | 'checkboxempty'
  | 'fullstar'
  | 'halfstar'
  | 'emptystar'
  | 'downarrow'
  | 'uparrow'
  | 'add'
  | 'pencil'
  | 'calendar'
  | 'success'
  | 'failure'
  | 'ic_search'
  | 'ic_arabic_success'
  | 'ic_arabic_failure';

type Props = SvgProps & { name: IconNames | undefined };
const IconSVG: React.FC<Props> = (props): any => {
  switch (props.name) {
    case 'gifticon':
      return <GiftIcon {...props} />;
    case 'checkboxempty':
      return <CheckboxEmpty {...props} />;
    case 'checkboxfilled':
      return <CheckboxFilled {...props} />;
    case 'fullstar':
      return <FullStar {...props} />;
    case 'halfstar':
      return <HalfStar {...props} />;
    case 'emptystar':
      return <EmptyStar {...props} />;
    case 'hidepassword':
      return <HidePassword {...props} />;
    case 'showpassword':
      return <ShowPassword {...props} />;
    case 'selectedradio':
      return <SelectedRadio {...props} />;
    case 'unselectedradio':
      return <UnselectedRadio {...props} />;
    case 'close':
      return <Close {...props} />;
    case 'downarrow':
      return <DownArrow {...props} />;
    case 'uparrow':
      return <UpArrow {...props} />;
    case 'add':
      return <AddIcon {...props} />;
    case 'pencil':
      return <PencilIcon {...props} />;
    case 'calendar':
      return <CalendarIcon {...props} />;
    case 'success':
      return <SuccessIcon {...props} />;
    case 'failure':
      return <FailureIcon {...props} />;
    case 'ic_search':
      return <SearchIcon {...props} />;
    case 'ic_arabic_success':
      return <Arabic_SuccessIcon {...props} />;
    case 'ic_arabic_failure':
      return <Arabic_FailureIcon {...props} />;
    default:
      return null;
  }
};
export default IconSVG;
