shopify-chatbot-widget 0.8.5 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/Chatbot/Chatbot.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { Spin } from 'antd';
|
|
|
11
11
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
12
12
|
|
|
13
13
|
const Chatbot: React.FC = () => {
|
|
14
|
-
const [open, setOpen] = useState(
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
15
|
const [viewMode, setViewMode] = useState<'sessions' | 'create' | 'messenger'>('sessions');
|
|
16
16
|
const [activeSessionId, setActiveSessionId] = useState<string | null>(null);
|
|
17
17
|
const [HasInfo, setHasInfo] = useState(false);
|
|
@@ -30,6 +30,7 @@ const Chatbot: React.FC = () => {
|
|
|
30
30
|
isFetchingDetails,
|
|
31
31
|
calendly,
|
|
32
32
|
disbleCheckout,
|
|
33
|
+
chatbotName,
|
|
33
34
|
} = useChatbotData();
|
|
34
35
|
|
|
35
36
|
const [visitorData, setVisitorData] = useState<{ visitorId: string; country: string } | null>(null);
|
|
@@ -43,7 +44,7 @@ const Chatbot: React.FC = () => {
|
|
|
43
44
|
const newSessionId = crypto.randomUUID();
|
|
44
45
|
setActiveSessionId(newSessionId);
|
|
45
46
|
setActiveAgentImage(chatbotLogo);
|
|
46
|
-
setActiveAgentName(
|
|
47
|
+
setActiveAgentName(chatbotName);
|
|
47
48
|
setNewSession(true);
|
|
48
49
|
setViewMode('messenger');
|
|
49
50
|
}
|
|
@@ -188,7 +189,7 @@ const Chatbot: React.FC = () => {
|
|
|
188
189
|
<Messenger
|
|
189
190
|
sessionId={activeSessionId}
|
|
190
191
|
chatbotLogo={activeAgentImage || chatbotLogo}
|
|
191
|
-
agentName={activeAgentName ||
|
|
192
|
+
agentName={activeAgentName || chatbotName || "Ai Assistant"}
|
|
192
193
|
colorCode={colorCode}
|
|
193
194
|
messagesSuggestions={messagesSuggestions}
|
|
194
195
|
newSession={newSession}
|
|
@@ -25,6 +25,7 @@ export const useChatbotData = () => {
|
|
|
25
25
|
const [restSuggestions, setRestSuggestions] = useState<string[]>([]);
|
|
26
26
|
const [userType,setUserType]=useState('')
|
|
27
27
|
const [disbleCheckout, setDisbleCheckout] = useState(false);
|
|
28
|
+
const [chatbotName,setchatbotName]=useState('')
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
const fetchData = async (retryCount = 0) => {
|
|
@@ -67,6 +68,7 @@ export const useChatbotData = () => {
|
|
|
67
68
|
setUserType(data.mode)
|
|
68
69
|
setCalendly(data.calendly_link ?? null);
|
|
69
70
|
setDisbleCheckout(data.disable_checkout)
|
|
71
|
+
setchatbotName(data.chatbot_name)
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
|
|
@@ -127,6 +129,7 @@ export const useChatbotData = () => {
|
|
|
127
129
|
messagesSuggestions,
|
|
128
130
|
restSuggestions,
|
|
129
131
|
userType,
|
|
130
|
-
disbleCheckout
|
|
132
|
+
disbleCheckout,
|
|
133
|
+
chatbotName
|
|
131
134
|
};
|
|
132
135
|
};
|