|
@@ -4,6 +4,7 @@
|
|
|
*/
|
|
*/
|
|
|
import { useState, useRef, useEffect } from "react";
|
|
import { useState, useRef, useEffect } from "react";
|
|
|
import { trpc } from "@/lib/trpc";
|
|
import { trpc } from "@/lib/trpc";
|
|
|
|
|
+import { useAuth } from "@/_core/hooks/useAuth";
|
|
|
import { Bot, X, Send, Loader2, User, Headphones, Sparkles, ChevronDown, MoreVertical } from "lucide-react";
|
|
import { Bot, X, Send, Loader2, User, Headphones, Sparkles, ChevronDown, MoreVertical } from "lucide-react";
|
|
|
import { Streamdown } from "streamdown";
|
|
import { Streamdown } from "streamdown";
|
|
|
|
|
|
|
@@ -15,6 +16,7 @@ const QUICK_REPLIES = [
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
export default function ChatbotWidgetLive() {
|
|
export default function ChatbotWidgetLive() {
|
|
|
|
|
+ const { user } = useAuth();
|
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
const [inputText, setInputText] = useState("");
|
|
const [inputText, setInputText] = useState("");
|
|
|
const [sessionId, setSessionId] = useState<string | null>(null);
|
|
const [sessionId, setSessionId] = useState<string | null>(null);
|
|
@@ -153,6 +155,11 @@ export default function ChatbotWidgetLive() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="flex items-center gap-1">
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
+ {user && (
|
|
|
|
|
+ <span className="text-[10px] text-white/60 mr-1">
|
|
|
|
|
+ {user.name || user.email}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ )}
|
|
|
<button className="p-1.5 rounded-lg hover:bg-white/10 transition-colors">
|
|
<button className="p-1.5 rounded-lg hover:bg-white/10 transition-colors">
|
|
|
<MoreVertical className="w-4 h-4 text-white/70" />
|
|
<MoreVertical className="w-4 h-4 text-white/70" />
|
|
|
</button>
|
|
</button>
|