From 42ab656ca3e7b05e461ebab38e366daef5fb5b37 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 23 Jun 2025 12:49:41 +0800 Subject: [PATCH] . --- apps/blogai/app/[locale]/morphic/action.tsx | 25 +++++++++++++++------ apps/blogai/app/[locale]/morphic/layout.tsx | 2 +- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/apps/blogai/app/[locale]/morphic/action.tsx b/apps/blogai/app/[locale]/morphic/action.tsx index 72d123c..42560e7 100644 --- a/apps/blogai/app/[locale]/morphic/action.tsx +++ b/apps/blogai/app/[locale]/morphic/action.tsx @@ -113,12 +113,23 @@ const initialUIState: { }[] = [] // AI is a provider you wrap your application with so you can access AI and UI state in your components. -export const AI = createAI({ - actions: { - submit - }, - // Each state can be any shape of object, but for chat applications - // it makes sense to have an array of messages. Or you may prefer something like { id: number, messages: Message[] } +// export const AI = createAI({ +// actions: { +// submit +// }, +// // Each state can be any shape of object, but for chat applications +// // it makes sense to have an array of messages. Or you may prefer something like { id: number, messages: Message[] } +// initialUIState, +// initialAIState +// }) + +export const { + AIProvider, + useUIState, + useAIState, + useActions +} = createAI({ + actions: { submit }, initialUIState, initialAIState -}) +}) \ No newline at end of file diff --git a/apps/blogai/app/[locale]/morphic/layout.tsx b/apps/blogai/app/[locale]/morphic/layout.tsx index fe8e277..af5e47a 100644 --- a/apps/blogai/app/[locale]/morphic/layout.tsx +++ b/apps/blogai/app/[locale]/morphic/layout.tsx @@ -54,7 +54,7 @@ export default function RootLayout({ disableTransitionOnChange > {/*
*/} - {children} + {children} {/*