diff --git a/app/chat/providers/chat-provider.tsx b/app/chat/chat-provider.tsx similarity index 96% rename from app/chat/providers/chat-provider.tsx rename to app/chat/chat-provider.tsx index d3b3970..410b3fc 100644 --- a/app/chat/providers/chat-provider.tsx +++ b/app/chat/chat-provider.tsx @@ -1,6 +1,6 @@ "use client"; import React, { createContext, useContext, useState, useEffect } from 'react'; -import { User } from '../types'; + const ChatContext = createContext(undefined); @@ -14,7 +14,7 @@ async function apiFetch(endpoint, options = {}) { export function ChatProvider({ children }) { const [line, setLine] = useState(null); const [instance, setInstance] = useState(null); - const [user] = useState({ + const [user] = useState({ id: `user_${Math.random().toString(36).slice(2)}`, name: 'You', }); diff --git a/app/chat/components/chat-layout.tsx b/app/chat/components/chat-layout.tsx deleted file mode 100644 index dc4f338..0000000 --- a/app/chat/components/chat-layout.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import { PersonSelector } from './selector/person-selector'; -import { ProjectorView } from './projector/projector-view'; -import { ChatWindow } from './chat/chat-window'; -import '../styles/layout.css'; - -export function ChatLayout() { - return ( -
-
- -
-
-
- -
-
- -
-
-
- ); -} diff --git a/app/chat/components/chat/chat-header.tsx b/app/chat/components/chat/chat-header.tsx deleted file mode 100644 index a73c463..0000000 --- a/app/chat/components/chat/chat-header.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { useChat } from '../../providers/chat-provider'; -import '../../styles/chat.css'; - -export function ChatHeader() { - const { instance } = useChat(); - return ( -
-
-

{instance?.name || 'Qwen Chat'}

- Online -
- -
- ); -} diff --git a/app/chat/components/chat/chat-input.tsx b/app/chat/components/chat/chat-input.tsx deleted file mode 100644 index c29908d..0000000 --- a/app/chat/components/chat/chat-input.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import React from 'react'; - -import { useChat } from '../../providers/chat-provider'; -import { useSound } from '../../providers/sound-provider'; -import '../../styles/chat.css'; - -export function ChatInput() { - const [message, setMessage] = React.useState(''); - const { sendActivity } = useChat(); - const { playSound } = useSound(); - - const handleSend = () => { - if (!message.trim()) return; - playSound('send'); - sendActivity({ - type: 'message', - text: message.trim(), - }); - setMessage(''); - }; - - - return ( - <> -
- - -