feat: add advisor/contact flow tables and make Blog.authorId required
Deploy Canina / deploy (push) Successful in 25m44s
Deploy Canina / deploy (push) Successful in 25m44s
This commit is contained in:
1 parent
bb81f2c944
commit
d881dc491e
86 files changed
+507
-4111
No files matched your search
@@ -160,41 +160,15 @@ export default function SupportChat() {
|
||||
// safe fallback kept
|
||||
}
|
||||
if (!controller.signal.aborted && token() === current) {
|
||||
// Typewriting animation for smooth AI assistant response streaming feel
|
||||
const fullAnswer = answer;
|
||||
const stepSize = Math.max(2, Math.floor(fullAnswer.length / 40));
|
||||
let currentIdx = 0;
|
||||
|
||||
const typeInterval = setInterval(() => {
|
||||
currentIdx += stepSize;
|
||||
if (currentIdx >= fullAnswer.length || controller.signal.aborted) {
|
||||
clearInterval(typeInterval);
|
||||
setRows((r) => {
|
||||
const next = [...r];
|
||||
const i = next.length - 1;
|
||||
if (i >= 0 && next[i].question === question) next[i] = { question, answer: fullAnswer };
|
||||
return next;
|
||||
});
|
||||
if (pending.current === controller) setBusy(false);
|
||||
} else {
|
||||
const partial = fullAnswer.slice(0, currentIdx) + " ▍";
|
||||
setRows((r) => {
|
||||
const next = [...r];
|
||||
const i = next.length - 1;
|
||||
if (i >= 0 && next[i].question === question) next[i] = { question, answer: partial };
|
||||
return next;
|
||||
});
|
||||
}
|
||||
}, 18);
|
||||
} else {
|
||||
if (pending.current === controller) setBusy(false);
|
||||
setRows((r) => { const next = [...r]; const i = next.length - 1; if (i >= 0 && next[i].question === question && next[i].answer === 'در حال بررسی…') next[i] = { question, answer }; return next; });
|
||||
}
|
||||
if (pending.current === controller) setBusy(false);
|
||||
}
|
||||
|
||||
if (!config?.enabled) return configError ? <span role="status" className="sr-only">تنظیمات پشتیبان هوشمند در دسترس نیست.</span> : null;
|
||||
const botIcon = { chat: '💬', paw: '🐾', bot: '🤖' }[config.icon];
|
||||
return (
|
||||
<aside dir="rtl" className="fixed bottom-24 sm:bottom-6 left-4 sm:left-6 z-30 max-w-[calc(100vw-2.5rem)] font-vazir select-none pb-[env(safe-area-inset-bottom,0px)]">
|
||||
<aside dir="rtl" className="fixed bottom-20 left-5 z-30 max-w-[calc(100vw-2.5rem)] font-vazir select-none">
|
||||
{/* Floating Launcher Button */}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user