|
| 1 | +import styles from "./kapa.module.css"; |
| 2 | + |
| 3 | +const Kapa = () => { |
| 4 | + const showTooltip = () => { |
| 5 | + let tips = document.getElementsByClassName(styles.Tooltip); |
| 6 | + if (tips.length > 0) { |
| 7 | + tips[0].style.display = "block"; |
| 8 | + } |
| 9 | + }; |
| 10 | + |
| 11 | + const hideTooltip = () => { |
| 12 | + let tips = document.getElementsByClassName(styles.Tooltip); |
| 13 | + if (tips.length > 0) { |
| 14 | + tips[0].style.display = "none"; |
| 15 | + } |
| 16 | + }; |
| 17 | + let kapaWidget = ( |
| 18 | + <div className={styles.FooterContainer}> |
| 19 | + <section className={styles.AskButtonContainer}> |
| 20 | + <button |
| 21 | + id="kapa-ai" |
| 22 | + type="button" |
| 23 | + className={styles.AskButton} |
| 24 | + onMouseOver={showTooltip} |
| 25 | + onMouseOut={hideTooltip} |
| 26 | + > |
| 27 | + <i className={styles.AskIcon}>forum</i> Ask AI |
| 28 | + </button> |
| 29 | + {/* <div className={styles.Tooltip}> |
| 30 | + <p>Try our new docs assistant!</p> |
| 31 | + </div> */} |
| 32 | + <script |
| 33 | + src="https://widget.kapa.ai/kapa-widget.bundle.js" |
| 34 | + data-website-id="e81c2b35-6c03-4576-a56c-3c825f866e06" |
| 35 | + data-project-name="Streamlit" |
| 36 | + data-project-color="#000000" |
| 37 | + data-project-logo="https://docs.streamlit.io/logo.svg" |
| 38 | + data-modal-title="Streamlit docs assistant (beta)" |
| 39 | + data-modal-disclaimer=" |
| 40 | + This AI chatbot is powered by kapa.ai and public Streamlit information. |
| 41 | + Answers may be inaccurate, inefficient, or biased. Any use or decisions |
| 42 | + based on such answers should include reasonable practices including |
| 43 | + human oversight to ensure they are safe, accurate, and suitable for |
| 44 | + your intended purpose. Streamlit is not liable for any actions, losses, |
| 45 | + or damages resulting from the use of the chatbot. |
| 46 | +
|
| 47 | + Do not enter any private, sensitive, personal, or regulated data. |
| 48 | + By using this chatbot, you acknowledge and agree that input you provide |
| 49 | + and answers you receive (collectively, “Content”) may be used by |
| 50 | + Streamlit and kapa.ai to provide, maintain, develop, and improve |
| 51 | + their respective offerings. For more information on how |
| 52 | + kapa.ai may use your Content, see https://www.kapa.ai/content/terms-of-service." |
| 53 | + data-button-hide="true" |
| 54 | + data-modal-override-open-id="kapa-ai" |
| 55 | + data-modal-lock-scroll="false" |
| 56 | + data-modal-border-radius="6px" |
| 57 | + data-modal-image-height="18px" |
| 58 | + data-answer-feedback-button-active-border="1px solid #808495" |
| 59 | + ></script> |
| 60 | + </section> |
| 61 | + </div> |
| 62 | + ); |
| 63 | + |
| 64 | + return kapaWidget; |
| 65 | +}; |
| 66 | + |
| 67 | +export default Kapa; |
0 commit comments