+ <>
+ {!chatList.length && !findChannel?.channel_prompt &&
}
{chatList.map((item, index) => (
{
)}
-
+ >
);
};
diff --git a/components/ChatSection/index.tsx b/components/ChatSection/index.tsx
index d8ee9f7..e8e0041 100644
--- a/components/ChatSection/index.tsx
+++ b/components/ChatSection/index.tsx
@@ -7,12 +7,17 @@ import ChatFooter from "./ChatFooter";
const ChatSection: React.FC = () => {
const [openai] = useOpenAI();
- // only the OpenAI Key or env OpenAI Key Configuration is not empty, show the chat section
- if (!openai.openAIKey && !openai.envOpenAIKey) return null;
+ if (
+ !openai.openai.apiKey &&
+ !openai.azure.apiKey &&
+ !openai.env.OPENAI_API_KEY &&
+ !openai.env.AZURE_API_KEY
+ )
+ return null;
return (
{
const { t } = useTranslation("menu");
+ const { theme, setTheme } = useTheme();
+ const { format } = useDateFormat();
+ const setOpen = useMobileMenuOpen((state) => state.update);
+ const [nowTheme, setNowTheme] = React.useState("");
+
const [channel, setChannel] = useChannel();
const open = useMobileMenuOpen((state) => state.open);
- const setOpen = useMobileMenuOpen((state) => state.update);
const setSettingOpen = useSettingOpen((state) => state.update);
- const { format } = useDateFormat();
-
const onClose = () => setOpen(false);
const stopPropagation = (e: any) => e.stopPropagation();
@@ -32,7 +38,13 @@ const MobileMenu: React.FC = () => {
setChannel((channel) => {
channel.list.push({
channel_id,
+ channel_icon: "RiChatSmile2Line",
channel_name: "",
+ channel_model: {
+ type: AI_MODELS[0].value,
+ name: AI_MODELS[0].models[0].value,
+ },
+ channel_prompt: "",
chat_list: [],
});
channel.activeId = channel_id;
@@ -76,18 +88,32 @@ const MobileMenu: React.FC = () => {
});
};
+ const onToggleTheme = () => setTheme(nowTheme === "light" ? "dark" : "light");
+
+ const onOpenPrompt = () => alert("Prompt Manage ToDo...");
+
const onSettingOpen = () => setSettingOpen(true);
+ React.useEffect(() => {
+ setNowTheme(theme === "dark" ? "dark" : "light");
+ }, [theme]);
+
return (
+
+ L - GPT
+
+
+ }
width="78%"
open={open}
onClose={onClose}
>
-