import { useState, useRef, useEffect } from 'react'; import { Send, Bot, User, Music, Sparkles } from 'lucide-react'; export default function ChatInterface({ messages, onSendMessage, isLoading, spotifyData }) { const [input, setInput] = useState(''); const messagesEndRef = useRef(null); const inputRef = useRef(null); const scrollToBottom = () => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); }; useEffect(() => { scrollToBottom(); }, [messages]); const handleSubmit = (e) => { e.preventDefault(); if (!input.trim() || isLoading) return; onSendMessage(input); setInput(''); }; return (
{spotifyData ? 'Connected to Spotify' : 'Waiting for Spotify data...'}
Start the conversation
Ask for recommendations based on your taste
{line}
))}AI can make mistakes. Verify important info.