Files
frontend/apps/wr/app/layout.tsx
T
2025-08-10 21:55:26 +09:00

45 lines
1012 B
TypeScript

"use client";
import "./globals.css";
import i18next from "i18next";
import { I18nextProvider } from "react-i18next";
import koBase from "../public/locales/ko/message.json";
import { StoreProvider } from "./store";
import { LoginApi } from "@/src/entities/auth";
import { useEffect } from "react";
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
i18next.init({
lng: "ko",
fallbackLng: "ko",
resources: {
ko: {
base: koBase,
},
},
});
useEffect(() => {
// 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치
void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" })
.catch((e) => {
console.error("Auto login failed:", e);
});
}, []);
return (
<html lang="en">
<body>
<I18nextProvider i18n={i18next}>
<StoreProvider>
{children}
</StoreProvider>
</I18nextProvider>
</body>
</html>
);
}