@@ -32,14 +30,15 @@ const Main: FC = ({ locale }) => {
-
+
{t('app.chats', locale)}
-
-
)
diff --git a/app/chat/@sidebar/page.tsx b/app/chat/@sidebar/page.tsx
index febfabd..b4f337c 100644
--- a/app/chat/@sidebar/page.tsx
+++ b/app/chat/@sidebar/page.tsx
@@ -1,7 +1,11 @@
import Main from './main'
+import { getLocale, client } from '@/service'
+
+async function getData() {}
const Sidebar = async () => {
- return
+ const conversations = await getData()
+ return
}
export default Sidebar
diff --git a/app/chat/main.tsx b/app/chat/main.tsx
index 345cd9d..05d9427 100644
--- a/app/chat/main.tsx
+++ b/app/chat/main.tsx
@@ -1,23 +1,9 @@
'use client'
import { FC } from 'react'
+import { AppProps, LocaleProps } from '@/interface'
-export interface AppProps {
- opening_statement: string
- suggested_questions: any[]
- suggested_questions_after_answer: {
- enabled: boolean
- }
- more_like_this: {
- enabled: boolean
- }
- user_input_form: any[]
-}
-interface ExtraProps {
- locale: string
-}
-
-const Main: FC
= ({ locale }) => {
- return {locale}
+const Main: FC = ({}) => {
+ return
}
export default Main
diff --git a/interface/index.ts b/interface/index.ts
new file mode 100644
index 0000000..265c3a9
--- /dev/null
+++ b/interface/index.ts
@@ -0,0 +1,27 @@
+export interface LocaleProps {
+ locale: string
+}
+
+export interface AppProps {
+ opening_statement: string
+ suggested_questions: any[]
+ suggested_questions_after_answer: {
+ enabled: boolean
+ }
+ more_like_this: {
+ enabled: boolean
+ }
+ user_input_form: any[]
+}
+
+export interface ConversationProps {
+ id: string
+ inputs: any
+ introduction: string
+ name: string
+ status: string
+}
+
+export interface ConversationsProps {
+ conversations: ConversationProps[]
+}
diff --git a/service/index.ts b/service/index.ts
index ba5d6e3..c9636f1 100644
--- a/service/index.ts
+++ b/service/index.ts
@@ -5,6 +5,6 @@ dotenv.config()
export const getLocale = () => {
const cookieStore = cookies()
- return cookieStore.get('locale')?.value
+ return cookieStore.get('locale')?.value || 'en' // default to english
}
export const client = new ChatClient(process.env.API_SECRET)