next-helios-fe 1.0.3 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,23 +37,25 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@iconify/react": "^5.0.1",
40
+ "dayjs": "^1.11.11",
40
41
  "flowbite-react": "^0.10.1",
41
42
  "next": "14.2.4",
42
43
  "postcss": "^8",
43
44
  "react": "^18.2.0",
44
45
  "react-dom": "^18.2.0",
45
46
  "tailwindcss": "^3.4.1",
46
- "typescript": "^5",
47
- "dayjs": "^1.11.11"
47
+ "typescript": "^5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@iconify/react": "^5.0.1",
51
51
  "@types/leaflet": "^1.9.12",
52
+ "@types/qrcode": "^1.5.5",
52
53
  "@types/react": "^18",
53
54
  "@types/react-big-calendar": "^1.8.9",
54
55
  "@types/react-dom": "^18",
55
56
  "@types/react-syntax-highlighter": "^15.5.13",
56
57
  "css-loader": "^7.1.2",
58
+ "dayjs": "^1.11.11",
57
59
  "flowbite-react": "^0.10.1",
58
60
  "next": "^14.2.4",
59
61
  "postcss": "^8",
@@ -66,7 +68,6 @@
66
68
  "ts-loader": "^9.5.1",
67
69
  "typescript": "^5",
68
70
  "webpack": "^5.93.0",
69
- "webpack-cli": "^5.1.4",
70
- "dayjs": "^1.11.11"
71
+ "webpack-cli": "^5.1.4"
71
72
  }
72
73
  }
@@ -27,3 +27,4 @@ export { BigCalendar } from "./calendar/big-calendar";
27
27
  export { Timeline } from "./timeline";
28
28
  export { DataTree } from "./data-tree";
29
29
  export { SyntaxHighlighter } from "./syntax-highlighter";
30
+ export { QRCode } from "./qr";
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import React, { useState, useEffect } from "react";
3
+ import Image from "next/image";
4
+ import QR from "qrcode";
5
+
6
+ interface QRProps {
7
+ value: string;
8
+ }
9
+
10
+ export const QRCode: React.FC<QRProps> = ({ value }) => {
11
+ const [qr, setQr] = useState<string>("");
12
+ const options = {
13
+ scale: 10,
14
+ quality: 0.1,
15
+ margin: 1,
16
+ };
17
+
18
+ useEffect(() => {
19
+ QR.toDataURL(value || "", options, (err: any, data: any) => {
20
+ if (err) {
21
+ console.log(err);
22
+ }
23
+ setQr(data);
24
+ });
25
+ }, [value]);
26
+
27
+ return <Image src={qr} alt="QR Code" width={200} height={200} />;
28
+ };