"use client"

import type { AppLocale } from "@cms/i18n"
import type { ReactNode } from "react"

import type { AdminMessages } from "@/i18n/messages"
import { AdminI18nProvider } from "@/providers/admin-i18n-provider"
import { QueryProvider } from "@/providers/query-provider"

export function Providers({
  children,
  locale,
  messages,
}: {
  children: ReactNode
  locale: AppLocale
  messages: AdminMessages
}) {
  return (
    <AdminI18nProvider locale={locale} messages={messages}>
      <QueryProvider>{children}</QueryProvider>
    </AdminI18nProvider>
  )
}
