import React from 'react';
import {ProfilePreviewType} from '../../types';
import SearchResult from './SearchResult';
import {StyleSheet, View} from 'react-native';
interface SearchResultsProps {
  results: Array<ProfilePreviewType>;
}
const SearchResults: React.FC<SearchResultsProps> = ({results}) => {
  return (
    <View>
      {results.map((profilePreview) => (
        <SearchResult
          style={styles.result}
          key={profilePreview.id}
          {...{profilePreview}}
        />
      ))}
    </View>
  );
};

const styles = StyleSheet.create({
  result: {
    marginVertical: 10,
  },
});

export default SearchResults;
