'use client'

import { LanguageProvider } from '@/lib/i18n/LanguageProvider'
import { LabelProvider } from '@/context/LabelContext'
import { NotebooksProvider } from '@/context/notebooks-context'
import { NotebookDragProvider } from '@/context/notebook-drag-context'
import { NoteRefreshProvider } from '@/context/NoteRefreshContext'
import type { ReactNode } from 'react'

interface ProvidersWrapperProps {
  children: ReactNode
  initialLanguage?: string
}

export function ProvidersWrapper({ children, initialLanguage = 'en' }: ProvidersWrapperProps) {
  return (
    <NoteRefreshProvider>
      <LabelProvider>
        <NotebooksProvider>
          <NotebookDragProvider>
            <LanguageProvider initialLanguage={initialLanguage as any}>
              {children}
            </LanguageProvider>
          </NotebookDragProvider>
        </NotebooksProvider>
      </LabelProvider>
    </NoteRefreshProvider>
  )
}
