"use strict";

import React, { useContext } from 'react';
import { ApplicationContext } from "../Context/index.js";
import { Image, VectorIcons } from "../Adapters/index.js";
import { jsx as _jsx } from "react/jsx-runtime";
const Icon = ({
  type,
  name,
  size = 24,
  color,
  ...rest
}) => {
  const {
    theme
  } = useContext(ApplicationContext);
  let Component;
  switch (type) {
    case 'FontAwesome5':
      Component = VectorIcons.FontAwesome5;
      break;
    case 'FontAwesome':
      Component = VectorIcons.FontAwesome;
      break;
    default:
      Component = VectorIcons.MaterialCommunityIcons;
      break;
  }
  if (type === 'Image') {
    return /*#__PURE__*/_jsx(Image, {
      ...rest,
      source: name,
      style: {
        width: size,
        height: size
      },
      resizeMode: 'contain'
    });
  }
  return /*#__PURE__*/_jsx(Component, {
    ...rest,
    name: name,
    size: size,
    color: color ?? theme.colors.text.default
  });
};
export { Icon };
//# sourceMappingURL=index.js.map