{"size": 985, "ext": "js", "max_stars_repo_path": "src/components/common/icon.js", "max_stars_repo_name": "Clip-sub/Sonix", "max_stars_repo_stars_event_min_datetime": "2018-08-02T09:01:06.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-09T01:10:11.000Z", "max_issues_repo_path": "src/components/common/icon.js", "max_issues_repo_name": "Clip-sub/Sonix", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/common/icon.js", "max_forks_repo_name": "Clip-sub/Sonix", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.9655172414, "max_line_length": 85, "alphanum_fraction": 0.621319797}
import React from 'react'
import PropTypes from 'prop-types'
import Ionicons from 'react-native-vector-icons/Ionicons'
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'

export const Icon = ({ name, size, color, ...rest }) => {
  switch (name) {
    case 'qr':
      return (
        <MaterialCommunityIcons name='qrcode' {...{ size, color, ...rest }} />
      )
    case 'cart':
      return (
        <MaterialCommunityIcons name='cart' {...{ size, color, ...rest }} />
      )
    case 'search':
      return <Ionicons name='ios-search' {...{ size, color, ...rest }} />
    case 'open-in-browser':
      return <MaterialIcons name='open-in-browser' {...{ size, color, ...rest }} />
    default:
      return <Ionicons name='ios-qr-scanner' {...{ size, color, ...rest }} />
  }
}

Icon.propTypes = {
  name: PropTypes.oneOf(['qr', 'cart', 'search', 'home', 'open-in-browser'])
}
