Skip to content

Commit b160ea8

Browse files
committed
Show AI assistant based on language
1 parent 94432d1 commit b160ea8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/ja-jp/AssistantModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ function AssistantModal({ isOpen, onClose }) {
77
// Get the current page URL.
88
const currentUrl = window.location.href;
99

10+
// Check if the user is on the Japanese documentation page.
11+
const isJapanese = currentUrl.includes("/ja-jp");
12+
1013
return (
1114
<div className="modal" style={styles.modal}>
1215
<div className="modal-content" style={styles.modalContent}>
1316
{/* Close the button. */}
1417
<span className="close" onClick={onClose} style={styles.closeButton}>
1518
&times;
1619
</span>
20+
21+
{/* Conditionally render the Typebot based on language. */}
1722
<Standard
18-
typebot="ja-jp-scalar-docs-ai-assistant-for-scalar-membership-program-members-201712"
23+
typebot={isJapanese
24+
? "ja-jp-scalar-docs-ai-assistant-for-scalar-membership-program-members-201712"
25+
: "en-us-scalar-docs-ai-assistant-for-scalar-membership-program-members-201712"
26+
}
1927
style={{ width: "100%", height: "600px" }}
2028
prefilledVariables={{
2129
"Current page URL": `${currentUrl}`, // Pass page URL as a query parameter.

0 commit comments

Comments
 (0)