'use client'

import { LanguageProvider } from '@/lib/i18n/LanguageProvider'
import { NoteRefreshProvider } from '@/context/NoteRefreshContext'
import { QueryProvider } from '@/components/query-provider'
import type { Translations } from '@/lib/i18n/load-translations'
import type { ReactNode } from 'react'

interface AdminProvidersWrapperProps {
  children: ReactNode
  initialLanguage?: string
  initialTranslations?: Translations
}

export function AdminProvidersWrapper({
  children,
  initialLanguage = 'en',
  initialTranslations,
}: AdminProvidersWrapperProps) {
  return (
    <QueryProvider>
      <NoteRefreshProvider>
        <LanguageProvider
          initialLanguage={initialLanguage as any}
          initialTranslations={initialTranslations}
        >
          {children}
        </LanguageProvider>
      </NoteRefreshProvider>
    </QueryProvider>
  )
}
