'use client';

import { useEffect } from 'react';
import { AuthProvider } from '@/components/auth/AuthContext';
import { ClientAuthInterceptor } from '@/components/auth/ClientAuthInterceptor';

export default function AppLayout({
  children,
}: {
  children: React.ReactNode
}) {
  // 使用useEffect确保主题只在客户端设置，避免水合问题
  useEffect(() => {
    // 可以在这里添加客户端特定的初始化逻辑
  }, []);

  return (
    <html lang="zh-CN" suppressHydrationWarning>
      <body suppressHydrationWarning>
        <AuthProvider>
          <ClientAuthInterceptor>
            {children}
          </ClientAuthInterceptor>
        </AuthProvider>
      </body>
    </html>
  )
}