lalochatbot_js
Version:
lalochatbot with Ai responses
77 lines (57 loc) • 1.51 kB
Markdown
```shell
npm install lalochatbot_js
```
```shell
yarn add lalochatbot_js
```
in the the page u want to show the chatplugin
```js
// chatplugin inside App.js
import { useState } from "react";
import "./App.css";
import { SiLivechat } from "react-icons/si";
import ChatApp from "lalochatbot_js";
function App() {
const [showEntry, setShowEntry] = useState(false);
const toggleChatApp = () => {
setShowEntry(!showEntry);
};
return (
<div className="App">
<SiLivechat className="home-icon" onClick={toggleChatApp} />
{showEntry && <ChatApp closeApp={toggleChatApp} />}
</div>
);
}
export default App;
```
```css
.home-icon {
background-color:
color:
position: absolute;
bottom: 0;
right: 0;
padding: 1%;
margin: 0 1.5% 0.8% 0;
height: 20px;
width: 20px;
border-radius: 5px;
cursor: pointer;
}
```
if You experience an issue like this:
```js
Could not find a declaration file for module 'lalochatbot_js'. '...../node_modules/lalochatbot_js/lib/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/lalochatbot_js` if it exists or add a new declaration (.d.ts) file containing `declare module 'lalochatbot_js';`
```
simply create a declaration file for the module in the root of your project named **`lalochatbot_js.d.ts`** and add this line:
```js
declare module 'lalochatbot_js';
```
hurray! is solved 🥳🥳🥳