File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,10 @@ import "./KapaWidget.css"
3
3
4
4
export default function KapaWidget ( ) {
5
5
const [ isScriptLoaded , setIsScriptLoaded ] = useState ( false )
6
- const [ child , setChild ] = useState < HTMLScriptElement | undefined > ( )
7
6
8
7
const loadKapaWidget = ( ) => {
9
- console . log ( "Kapai" , window . Kapa )
10
-
11
8
if ( isScriptLoaded ) {
12
- document . body . removeChild ( child )
9
+ return
13
10
}
14
11
15
12
const script = document . createElement ( "script" )
@@ -30,15 +27,15 @@ export default function KapaWidget() {
30
27
script . setAttribute ( "data-project-logo" , "/docs/img/kapa-logo.png" )
31
28
script . setAttribute ( "data-consent-required" , "true" )
32
29
script . setAttribute ( "data-button-hide" , "true" )
33
- script . setAttribute ( "data-modal-override-open-id" , "custom-button-id " )
30
+ script . setAttribute ( "data-modal-override-open-id" , "kapa-ai-button " )
34
31
script . setAttribute ( "data-modal-open-by-default" , "true" )
35
32
script . onload = ( ) => setIsScriptLoaded ( true )
36
- setChild ( document . body . appendChild ( script ) )
33
+ document . body . appendChild ( script )
37
34
}
38
35
39
36
return (
40
37
< button
41
- id = "custom-button-id "
38
+ id = "kapa-ai-button "
42
39
className = "mantine-UnstyledButton-root mantine-Button-root mantine-124rx6h"
43
40
type = "button"
44
41
data-button = "true"
You can’t perform that action at this time.
0 commit comments