mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-25 17:15:19 +08:00
34 lines
881 B
TypeScript
34 lines
881 B
TypeScript
import { Analytics } from "@vercel/analytics/react";
|
|
import dayjs from "dayjs";
|
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
import { AppProps } from "next/app";
|
|
import React, { useEffect } from "react";
|
|
import { Toaster } from "react-hot-toast";
|
|
import { useTranslation } from "react-i18next";
|
|
dayjs.extend(localizedFormat);
|
|
import { useSettingStore } from "@/store";
|
|
|
|
import "@/locales/i18n";
|
|
import "@/styles/tailwind.css";
|
|
import "@/styles/global.css";
|
|
import "@/styles/data-table.css";
|
|
|
|
function MyApp({ Component, pageProps }: AppProps) {
|
|
const { i18n } = useTranslation();
|
|
const settingStore = useSettingStore();
|
|
|
|
useEffect(() => {
|
|
i18n.changeLanguage(settingStore.setting.locale);
|
|
}, [settingStore.setting.locale]);
|
|
|
|
return (
|
|
<>
|
|
<Component {...pageProps} />
|
|
<Toaster />
|
|
<Analytics />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|