{"size": 818, "ext": "js", "max_stars_repo_path": "src/components/Discovery/Search.js", "max_stars_repo_name": "cyruzin/feelthemovies_mobile", "max_stars_repo_stars_event_min_datetime": "2019-02-21T16:42:22.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-29T06:41:31.000Z", "max_issues_repo_path": "src/components/Discovery/Search.js", "max_issues_repo_name": "cyruzin/feelthemovies_mobile", "max_issues_repo_issues_event_min_datetime": "2019-02-17T01:29:40.000Z", "max_issues_repo_issues_event_max_datetime": "2019-03-24T17:26:08.000Z", "max_forks_repo_path": "src/components/Discovery/Search.js", "max_forks_repo_name": "cyruzin/feelthemovies_mobile", "max_forks_repo_forks_event_min_datetime": "2019-08-13T05:53:33.000Z", "max_forks_repo_forks_event_max_datetime": "2019-08-13T05:53:33.000Z"}
{"max_stars_count": 4, "max_issues_count": 6, "max_forks_count": 1, "avg_line_length": 19.023255814, "max_line_length": 40, "alphanum_fraction": 0.5452322738}
import React from 'react';
import {
  View,
  StyleSheet,
  TouchableOpacity
} from 'react-native';

import { Text } from '../UI';

export default function Search (props) {
  const { result, onPress } = props;

  return result.length > 0 && (
    <View style={styles.content}>
      {result.map(value => (
        <TouchableOpacity
          key={value.id || value}
          style={{ marginBottom: 10 }}
          onPress={() => onPress(value)}
        >
          <Text style={styles.title}>
            {value.name || value}
          </Text>
        </TouchableOpacity>
      ))}
    </View>
  );
}

const styles = StyleSheet.create({
  content: {
    flex: 1,
    padding: 10,
    marginBottom: 10,
    backgroundColor: '#1b1919',
    borderRadius: 5
  },
  title: {
    fontSize: 17,
    color: '#737373'
  }
})
