diff --git a/ee/tabby-ui/components/chat-sessions.tsx b/ee/tabby-ui/app/playground/components/chat-sessions.tsx similarity index 98% rename from ee/tabby-ui/components/chat-sessions.tsx rename to ee/tabby-ui/app/playground/components/chat-sessions.tsx index 4c756940e07..970788cf0f6 100644 --- a/ee/tabby-ui/components/chat-sessions.tsx +++ b/ee/tabby-ui/app/playground/components/chat-sessions.tsx @@ -14,7 +14,7 @@ import { TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import { EditChatTitleDialog } from '@/components/edit-chat-title-dialog' +import { EditChatTitleDialog } from './edit-chat-title-dialog' import { useStore } from '@/lib/hooks/use-store' import { Button } from '@/components/ui/button' import { ListSkeleton } from '@/components/skeleton' diff --git a/ee/tabby-ui/app/playground/components/chats.tsx b/ee/tabby-ui/app/playground/components/chats.tsx index 4f32f2a76d6..010125ba668 100644 --- a/ee/tabby-ui/app/playground/components/chats.tsx +++ b/ee/tabby-ui/app/playground/components/chats.tsx @@ -4,7 +4,7 @@ import React from 'react' import { Chat } from '@/components/chat' import { useChatStore } from '@/lib/stores/chat-store' import { getChatById } from '@/lib/stores/utils' -import { ChatSessions } from '@/components/chat-sessions' +import { ChatSessions } from './chat-sessions' import { useStore } from '@/lib/hooks/use-store' import type { Message } from 'ai' diff --git a/ee/tabby-ui/components/clear-chats-button.tsx b/ee/tabby-ui/app/playground/components/clear-chats-button.tsx similarity index 100% rename from ee/tabby-ui/components/clear-chats-button.tsx rename to ee/tabby-ui/app/playground/components/clear-chats-button.tsx diff --git a/ee/tabby-ui/components/edit-chat-title-dialog.tsx b/ee/tabby-ui/app/playground/components/edit-chat-title-dialog.tsx similarity index 98% rename from ee/tabby-ui/components/edit-chat-title-dialog.tsx rename to ee/tabby-ui/app/playground/components/edit-chat-title-dialog.tsx index d40955b550f..b7ad39de2e8 100644 --- a/ee/tabby-ui/components/edit-chat-title-dialog.tsx +++ b/ee/tabby-ui/app/playground/components/edit-chat-title-dialog.tsx @@ -17,7 +17,7 @@ import { IconArrowElbow, IconEdit, IconTrash } from '@/components/ui/icons' import { Input } from '@/components/ui/input' import { updateChat } from '@/lib/stores/chat-actions' -import { Button } from './ui/button' +import { Button } from '@/components/ui/button' interface EditChatTitleDialogProps { initialValue: string | undefined diff --git a/ee/tabby-ui/components/chat-context.tsx b/ee/tabby-ui/components/chat-context.tsx deleted file mode 100644 index 587208f5ff8..00000000000 --- a/ee/tabby-ui/components/chat-context.tsx +++ /dev/null @@ -1,38 +0,0 @@ -'use client' - -import React from 'react' -import { Message, UseChatHelpers, useChat } from 'ai/react' -import { toast } from 'react-hot-toast' - -export interface ChatContextValue extends UseChatHelpers { - id: string | undefined -} - -export const ChatContext = React.createContext({} as ChatContextValue) -export interface ChatContextProviderProps { - id: string | undefined - initialMessages?: Message[] -} - -export const ChatContextProvider: React.FC< - React.PropsWithChildren -> = ({ children, id, initialMessages }) => { - const chatHelpers = useChat({ - initialMessages, - id, - body: { - id - }, - onResponse(response) { - if (response.status === 401) { - toast.error(response.statusText) - } - } - }) - - return ( - - {children} - - ) -}