Skip to content

An AI-powered search engine with a generative UI

Merge branch 'main' of https://github.com/miurla/morphic into rc-0.1.8

Yoshiki Miurae20e650d85d0
diff --cc bun.lockb
index 50d9a0e1,1df8ab2f..1df8ab2f
mode 100644,100755..100644
Binary files differ
diff --cc components/chat-panel.tsx
index 51113493,93d95142..dde8579d
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@@ -5,18 -6,22 +6,23 @@@ import { cn } from '@/lib/utils
import { UserMessage } from './user-message'
import { Input } from './ui/input'
import { Button } from './ui/button'
- import { ArrowRight, Plus, Square } from 'lucide-react'
+ import { ArrowRight, Plus } from 'lucide-react'
import { EmptyScreen } from './empty-screen'
+import Textarea from 'react-textarea-autosize'
+ import { nanoid } from 'ai'
- export function ChatPanel() {
+ interface ChatPanelProps {
+ messages: UIState
+ }
+
+ export function ChatPanel({ messages }: ChatPanelProps) {
const [input, setInput] = useState('')
- const [messages, setMessages] = useUIState<typeof AI>()
- const [aiMessages, setAiMessages] = useAIState<typeof AI>()
- const { submit } = useActions<typeof AI>()
+ const [, setMessages] = useUIState<typeof AI>()
+ const { submit } = useActions()
const [isButtonPressed, setIsButtonPressed] = useState(false)
- const inputRef = useRef<HTMLInputElement>(null)
+ const inputRef = useRef<HTMLTextAreaElement>(null)
const [showEmptyScreen, setShowEmptyScreen] = useState(false)
+ const router = useRouter()
// Focus on input when button is pressed
useEffect(() => {
if (isButtonPressed) {