Files
frontend/apps/wr/app/layout.tsx
T

50 lines
1.1 KiB
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";
const i18n = i18next.createInstance();
i18n.init({
lng: "ko",
fallbackLng: "ko",
resources: {
ko: {
base: koBase,
},
},
});
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
useEffect(() => {
// 렌더 중이 아니라 클라이언트에서만 실행 + 에러 캐치
void LoginApi.login({ userId: "CLEANWATER", password: "gktneh12!@" })
.finally(()=>{
// getCommonUpCd()
} )
.catch((e) => {
console.error("Auto login failed:", e);
});
}, []);
return (
<html lang="ko">
<body>
<I18nextProvider i18n={i18n}>
<StoreProvider>
{children}
</StoreProvider>
</I18nextProvider>
</body>
</html>
);
}