text: import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
  
  const cryptoNewsApiHeaders = {
      'x-bingapis-sdk': 'true',
      'x-rapidapi-host': process.env.REACT_APP_NEWS_RAPIDAPI_HOST,
      'x-rapidapi-key': process.env.REACT_APP_RAPIDAPI_KEY
  }
  
  
  const createRequest = (url) => ({ url, headers: cryptoNewsApiHeaders})
  
  export const cryptoNewsApi = createApi({
      reducerPath: 'cryptoNewsApi',
      baseQuery: fetchBaseQuery({ baseUrl: process.env.REACT_APP_NEWS_API_URL }),
      endpoints: (builder) => ({
  			getCryptoNews: builder.query({
  				query: ({ newsCategory, amount }) => createRequest(`/news/search?q=${newsCategory}&safeSearch=Off&textFormat=Raw&freshness=Day&count=${amount}`),
  			}),
      })
  })
  
  export const { useGetCryptoNewsQuery } = cryptoNewsApi;