aboutsummaryrefslogtreecommitdiff
path: root/src/components/search/SearchResults.tsx
blob: 001c7968b444b5c263dc7a8916bcfb45f8582f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import {ProfilePreviewType, PreviewType, ScreenType} from '../../types';
import ProfilePreview from '../profile/ProfilePreview';
import {StyleSheet, View} from 'react-native';
interface SearchResultsProps {
  results: Array<ProfilePreviewType>;
  previewType: PreviewType;
  screenType: ScreenType;
}
const SearchResults: React.FC<SearchResultsProps> = ({
  results,
  previewType,
  screenType,
}) => {
  return (
    <View style={styles.container}>
      {results.map((profilePreview) => (
        <ProfilePreview
          style={styles.result}
          key={profilePreview.id}
          {...{profilePreview}}
          previewType={previewType}
          screenType={screenType}
        />
      ))}
    </View>
  );
};

const styles = StyleSheet.create({
  container: {flexDirection: 'row', flexWrap: 'wrap'},
  result: {
    marginVertical: 10,
  },
});

export default SearchResults;