@nethru/kit 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,5 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
2
  import { getConfig } from "../../../js/config";
3
- const {
4
- apiUrl
5
- } = getConfig();
6
3
  const useChatApi = defaultMessages => {
7
4
  const [messages, setMessages] = useState(defaultMessages ? defaultMessages : []);
8
5
  const [inputValue, setInputValue] = useState('');
@@ -22,6 +19,9 @@ const useChatApi = defaultMessages => {
22
19
  }
23
20
  };
24
21
  const loadTools = async () => {
22
+ const {
23
+ apiUrl
24
+ } = getConfig();
25
25
  try {
26
26
  const response = await fetch(`${apiUrl}/api/mcp/tools`);
27
27
  const data = await response.json();
@@ -31,6 +31,9 @@ const useChatApi = defaultMessages => {
31
31
  }
32
32
  };
33
33
  const sendMessage = async () => {
34
+ const {
35
+ apiUrl
36
+ } = getConfig();
34
37
  const message = inputValue.trim();
35
38
  if (!message) return;
36
39
  const userMessage = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/kit",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A React component library by Nethru",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "@mui/icons-material": "^6.5.0",
42
42
  "@mui/material": "^6.0.1",
43
- "@nethru/kit": "^1.0.7",
43
+ "@nethru/kit": "^1.1.0",
44
44
  "@nethru/ui": "^2.1.45",
45
45
  "highcharts": "^11.3.0",
46
46
  "highcharts-react-official": "^3.2.1",