import React, {useMemo} from 'react'

import {
  createShopMinisQueryClient,
  ShopMinisQueryClientContext,
} from './queryClient'

export function MinisQueryProvider({children}: {children: React.ReactNode}) {
  const queryClient = useMemo(() => createShopMinisQueryClient(), [])

  return (
    <ShopMinisQueryClientContext.Provider value={queryClient}>
      {children}
    </ShopMinisQueryClientContext.Provider>
  )
}
