This commit is contained in:
parent
42674b9b48
commit
3adfdf9344
|
|
@ -7,7 +7,6 @@ import { auth } from '@/auth'
|
||||||
|
|
||||||
import { Header } from '@/components/header'
|
import { Header } from '@/components/header'
|
||||||
import { Footer, Footer_bak } from '@/components/footer'
|
import { Footer, Footer_bak } from '@/components/footer'
|
||||||
// import { Web3Provider } from '@/components/providers/web3-provider'
|
|
||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
|
|
||||||
import { useTranslation, Trans } from "next-i18next";
|
import { useTranslation, Trans } from "next-i18next";
|
||||||
|
|
@ -18,14 +17,6 @@ import { PromptFormIndex } from '@/components/prompt-index'
|
||||||
import { ChatModel } from '@/components/chat-model'
|
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[] = [
|
const initialMessages: Message[] = [
|
||||||
{
|
{
|
||||||
id: nanoid(),
|
id: nanoid(),
|
||||||
|
|
@ -127,18 +118,11 @@ export const metadata: Metadata = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const i18nNamespaces = ['common', 'home'];
|
|
||||||
|
|
||||||
export default async function ChatIndexPage({ params: { locale } }: { params: { locale: string } }) {
|
export default async function ChatIndexPage({ params: { locale } }: { params: { locale: string } }) {
|
||||||
const session = await auth()
|
const session = await auth()
|
||||||
const avatarUrl = session?.user?.image
|
const avatarUrl = session?.user?.image
|
||||||
const id = nanoid()
|
const id = nanoid()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const { t, resources } = await initTranslations(locale, i18nNamespaces);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <Web3Provider> */}
|
{/* <Web3Provider> */}
|
||||||
|
|
@ -155,7 +139,7 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
|
||||||
<LogoAI
|
<LogoAI
|
||||||
className='flex text-center m-auto'
|
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} />
|
<ChatModel className='' position='relative lg:w-full' id={id} showLanding avatarUrl={avatarUrl} />
|
||||||
{/* <PromptFormIndex
|
{/* <PromptFormIndex
|
||||||
|
|
@ -176,8 +160,8 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
|
||||||
// input={input}
|
// input={input}
|
||||||
// setInput={setInput}
|
// setInput={setInput}
|
||||||
// isLoading={isLoading}
|
// isLoading={isLoading}
|
||||||
/> */}
|
/> }
|
||||||
</div>
|
</div> */}
|
||||||
</FadeIn>
|
</FadeIn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export const {
|
||||||
auth
|
auth
|
||||||
} = NextAuth({
|
} = NextAuth({
|
||||||
providers: [
|
providers: [
|
||||||
// GitHub,
|
|
||||||
Google,
|
Google,
|
||||||
],
|
],
|
||||||
|
|
||||||
callbacks: {
|
callbacks: {
|
||||||
async jwt({ token, profile }) {
|
async jwt({ token, profile }) {
|
||||||
if (profile?.id) {
|
if (profile?.id) {
|
||||||
|
|
@ -41,13 +41,9 @@ export const {
|
||||||
}
|
}
|
||||||
return session
|
return session
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
pages: {
|
||||||
|
signIn: '/sign-in'
|
||||||
|
}
|
||||||
|
|
||||||
// uncomment to require authentication
|
|
||||||
// authorized({ auth }) {
|
|
||||||
// return !!auth?.user
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
pages: {
|
|
||||||
signIn: '/sign-in'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -471,7 +471,6 @@ const NineGrid: React.FC<NineGridProps> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const Article = () => {
|
const Article = () => {
|
||||||
// const { t } = useTranslation();
|
|
||||||
const { t, i18n } = useTranslation()
|
const { t, i18n } = useTranslation()
|
||||||
|
|
||||||
console.log("-----i18n-----", i18n.language)
|
console.log("-----i18n-----", i18n.language)
|
||||||
|
|
@ -479,11 +478,7 @@ const Article = () => {
|
||||||
const language = i18n.language
|
const language = i18n.language
|
||||||
|
|
||||||
const defCategories: TagItem[] = [
|
const defCategories: TagItem[] = [
|
||||||
|
|
||||||
{ name: t("article.all"), value: "" }
|
{ name: t("article.all"), value: "" }
|
||||||
// '#ALL',
|
|
||||||
// '#AI',
|
|
||||||
// '#Blockchain',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const categoriesRef = useRef(defCategories);
|
const categoriesRef = useRef(defCategories);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue