'use client';

import { useEffect, useState } from 'react';
import dynamic from 'next/dynamic';
import { Center, Spinner } from '@chakra-ui/react';

const MainApp = dynamic(() => import('./MainApp'), {
  loading: () => (
    <Center h="100vh">
      <Spinner size="xl" />
    </Center>
  ),
});

export default function MainAppWrapper() {
  const [isMounted, setIsMounted] = useState(false);

  useEffect(() => {
    setIsMounted(true);
  }, []);

  if (!isMounted) {
    return (
      <Center h="100vh">
        <Spinner size="xl" />
      </Center>
    );
  }

  return <MainApp />;
} 