"use client";

import { useState, type PropsWithChildren } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ServiceWorkerRegister } from "@/components/layout/service-worker-register";
import { I18nProvider } from "@/lib/i18n";

export function Providers({ children }: PropsWithChildren) {
  const [queryClient] = useState(() => new QueryClient());
  return (
    <I18nProvider>
      <QueryClientProvider client={queryClient}>
        {children}
        <ServiceWorkerRegister />
      </QueryClientProvider>
    </I18nProvider>
  );
}
