text: // @flow
  import React, { useContext } from "react";
  import { FlatList } from "react-native";
  import ProviderCell from "./ProviderCell";
  import SeparatorComponent from "./SeparatorComponent";
  import { PluginContext } from "../Config/PluginData";
  
  type Props = {
    data: any,
    setProviderID: (any) => void,
  };
  
  export default function ProvidersList({ data, setProviderID }: Props) {
    const {
      customStyle: { listBackgroundColor },
    } = useContext(PluginContext);
  
    return (
      <FlatList
        ItemSeparatorComponent={({ highlighted }) => (
          <SeparatorComponent highlighted={highlighted} />
        )}
        data={data}
        renderItem={({ item }) => (
          <ProviderCell item={item} setProviderID={setProviderID} />
        )}
        keyExtractor={(item) => item.id}
        style={{ backgroundColor: listBackgroundColor }}
        ListFooterComponent={() => <SeparatorComponent />}
      />
    );
  }
  