diff --git a/package.json b/package.json index 06feb95..926fa77 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "axios": "^1.6.7", "html-to-text": "^9.0.5", "langchain": "^0.1.9", + "lucide-react": "^0.323.0", "plasmo": "0.84.1", "property-information": "^6.4.1", "react": "18.2.0", @@ -78,7 +79,8 @@ "scripting", "declarativeNetRequest", "declarativeNetRequestFeedback", - "action" + "action", + "unlimitedStorage" ] } } diff --git a/src/background.ts b/src/background.ts index e67032f..172269e 100644 --- a/src/background.ts +++ b/src/background.ts @@ -13,9 +13,4 @@ chrome.runtime.onMessage.addListener(async (message) => { chrome.action.onClicked.addListener((tab) => { chrome.tabs.create({url: chrome.runtime.getURL("options.html")}); -}); - -// listen to commadns -chrome.commands.onCommand.addListener((command) => { - console.log('Command', command) -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/src/components/Common/Playground/Message.tsx b/src/components/Common/Playground/Message.tsx index d946b45..a469ae6 100644 --- a/src/components/Common/Playground/Message.tsx +++ b/src/components/Common/Playground/Message.tsx @@ -55,43 +55,45 @@ export const PlaygroundMessage = (props: Props) => { {/* source if aviable */} - + {props.images && ( +
+ {props.images + .filter((image) => image.length > 0) + .map((image, index) => ( +
+ Uploaded +
+ ))} +
+ )} - {props.isBot && ( -
- {!props.hideCopy && ( - - )} -
- )} + {props.isBot && ( +
+ {!props.hideCopy && ( + + )} +
+ )} + - {props.images && ( -
- {props.images - .filter((image) => image.length > 0) - .map((image, index) => ( -
- Uploaded -
- ))} -
- )} ) } diff --git a/src/components/Option/Layout.tsx b/src/components/Option/Layout.tsx new file mode 100644 index 0000000..99b9422 --- /dev/null +++ b/src/components/Option/Layout.tsx @@ -0,0 +1,113 @@ +import React, { Fragment, useState } from "react" +import { Dialog, Menu, Transition } from "@headlessui/react" +import { + Bars3BottomLeftIcon, + XMarkIcon, + TagIcon, + CircleStackIcon, + CogIcon, + ChatBubbleLeftIcon, + Bars3Icon, + Bars4Icon, + ArrowPathIcon +} from "@heroicons/react/24/outline" +import logoImage from "data-base64:~assets/icon.png" + +import { Link, useParams, useLocation, useNavigate } from "react-router-dom" +import { Sidebar } from "./Sidebar" +import { Drawer, Layout, Select } from "antd" +import { useQuery } from "@tanstack/react-query" +import { fetchModels } from "~services/ollama" +import { useMessageOption } from "~hooks/useMessageOption" +import { PanelLeftIcon, Settings2 } from "lucide-react" + +const navigation = [ + { name: "Embed", href: "/bot/:id", icon: TagIcon }, + { + name: "Preview", + href: "/bot/:id/preview", + icon: ChatBubbleLeftIcon + }, + { + name: "Data Sources", + href: "/bot/:id/data-sources", + icon: CircleStackIcon + }, + { + name: "Settings", + href: "/bot/:id/settings", + icon: CogIcon + } +] + +//@ts-ignore - +function classNames(...classes) { + return classes.filter(Boolean).join(" ") +} + +export default function OptionLayout({ + children +}: { + children: React.ReactNode +}) { + const [sidebarOpen, setSidebarOpen] = useState(false) + const params = useParams<{ id: string }>() + const location = useLocation() + + const { + data: models, + isLoading: isModelsLoading, + refetch: refetchModels, + isFetching: isModelsFetching + } = useQuery({ + queryKey: ["fetchModel"], + queryFn: fetchModels + }) + + const { selectedModel, setSelectedModel } = useMessageOption() + + return ( + +
+
+
+ +
+
+ + +