import { QueryClientProvider } from '@tanstack/react-query'
import { RouterProvider } from '@tanstack/react-router'
import { Toaster } from 'react-hot-toast'
import { queryClient } from '@/lib/queryClient'
import { router } from '@/router'
import { usePWA } from '@/hooks/usePWA'

export function App() {
  usePWA()
  return (
    <QueryClientProvider client={queryClient}>
      <RouterProvider router={router} />
      <Toaster
        position="bottom-right"
        toastOptions={{
          style: {
            background: '#141414',
            color: '#ffffff',
            border: '1px solid rgba(65,65,65,0.8)',
          },
          success: {
            iconTheme: { primary: '#faff69', secondary: '#000000' },
          },
        }}
      />
    </QueryClientProvider>
  )
}
