'use client';

import { useEffect } from 'react';
import { Provider } from 'react-redux';
import { initializeState } from './slices/boxSlice';
import { store } from './store';

export function ReduxProvider({ children }: { children: React.ReactNode }) {
  // Inicijaliziraj stanje iz localStorage nakon što se komponenta montira
  useEffect(() => {
    store.dispatch(initializeState());
  }, []);

  return <Provider store={store}>{children}</Provider>;
} 