'use client';

import { Provider } from 'react-redux';

import { LanguageProvider } from '../language';
import { store } from '../store';
import { ThemeProvider } from '../theme/theme-provider';
import { AosProvider } from './aos-provider';
import { Toaster } from './toaster';

type ProvidersProps = {
  children: React.ReactNode;
};

export const Providers = ({ children }: ProvidersProps) => {
  return (
    <Provider store={store}>
      <LanguageProvider>
        <ThemeProvider
          attribute='class'
          defaultTheme='system'
          enableSystem
          disableTransitionOnChange
        >
          <AosProvider>
            {children}
            <Toaster />
          </AosProvider>
        </ThemeProvider>
      </LanguageProvider>
    </Provider>
  );
};
