text: import { useEffect } from "react"
  import cleanupServicebot from "../functions/cleanup-servicebot"
  
  const useBillflowBeta = props => {
    const { settings } = props
  
    useEffect(() => {
      /**
       * Servicebot React code example
       * https://gist.github.com/bsears90/34c56aab019296e99751b7e802b2a39a
       */
  
      window.servicebotSettings = {
        ...settings
      }
      ;(function () {
        var s = document.createElement("script")
        s.src =
          "https://js.billflow.io/beta/billflow-embed.js"
        s.async = true
        s.type = "text/javascript"
        s.id = "servicebot-embed-js"
        var x = document.getElementsByTagName("script")[0]
        x.parentNode.insertBefore(s, x)
      })()
  
      return () => {
        cleanupServicebot()
      }
    })
  
    return { settings }
  }
  
  export default useBillflowBeta
  