This commit is contained in:
hailin 2025-03-12 00:26:57 +08:00
parent 42674b9b48
commit 3adfdf9344
3 changed files with 9 additions and 34 deletions

View File

@ -7,7 +7,6 @@ import { auth } from '@/auth'
import { Header } from '@/components/header'
import { Footer, Footer_bak } from '@/components/footer'
// import { Web3Provider } from '@/components/providers/web3-provider'
import { Metadata } from 'next'
import { useTranslation, Trans } from "next-i18next";
@ -18,14 +17,6 @@ import { PromptFormIndex } from '@/components/prompt-index'
import { ChatModel } from '@/components/chat-model'
// system:系统角色 ,用来设置机器人的行为
// user用户角色和AI对话的用户
// assistant助理角色AI机器人
// {"role": "system", "content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."},
// {"role": "user", "content": "Compose a poem that explains the concept of recursion in programming."}
const initialMessages: Message[] = [
{
id: nanoid(),
@ -127,18 +118,11 @@ export const metadata: Metadata = {
}
}
// const i18nNamespaces = ['common', 'home'];
export default async function ChatIndexPage({ params: { locale } }: { params: { locale: string } }) {
const session = await auth()
const avatarUrl = session?.user?.image
const id = nanoid()
// const { t, resources } = await initTranslations(locale, i18nNamespaces);
return (
<>
{/* <Web3Provider> */}
@ -155,7 +139,7 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
<LogoAI
className='flex text-center m-auto'
/>
<div className="space-y-4 py-[4rem] w-5/6 lg:w-5/6 xl:w-4/5 2xl:w-3/4 m-auto">
{/* <div className="space-y-4 py-[4rem] w-5/6 lg:w-5/6 xl:w-4/5 2xl:w-3/4 m-auto">
<ChatModel className='' position='relative lg:w-full' id={id} showLanding avatarUrl={avatarUrl} />
{/* <PromptFormIndex
@ -176,8 +160,8 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
// input={input}
// setInput={setInput}
// isLoading={isLoading}
/> */}
</div>
/> }
</div> */}
</FadeIn>
</div>

View File

@ -18,9 +18,9 @@ export const {
auth
} = NextAuth({
providers: [
// GitHub,
Google,
],
callbacks: {
async jwt({ token, profile }) {
if (profile?.id) {
@ -41,13 +41,9 @@ export const {
}
return session
}
// uncomment to require authentication
// authorized({ auth }) {
// return !!auth?.user
// }
},
pages: {
signIn: '/sign-in'
}
})

View File

@ -471,7 +471,6 @@ const NineGrid: React.FC<NineGridProps> = ({
};
const Article = () => {
// const { t } = useTranslation();
const { t, i18n } = useTranslation()
console.log("-----i18n-----", i18n.language)
@ -479,11 +478,7 @@ const Article = () => {
const language = i18n.language
const defCategories: TagItem[] = [
{ name: t("article.all"), value: "" }
// '#ALL',
// '#AI',
// '#Blockchain',
]
const categoriesRef = useRef(defCategories);