import React from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { trpc } from '~/app/_trpc/Client' 
import { createTestTrpcClient } from './vitest.trpcProxyClient'

export default function TrpcProvider({ children }:{children: React.ReactNode}) {
  const queryClient = new QueryClient()
  const trpcClient = createTestTrpcClient()
  console.log("using test provider")
  return (
    <trpc.Provider client={trpcClient} queryClient={queryClient}>
      <QueryClientProvider client={queryClient}>
        {children}
      </QueryClientProvider>
    </trpc.Provider>
  )}
