@genai-fi/base 4.3.0 → 4.3.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,10 +1,11 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
application: string;
|
|
4
|
+
apiUrl: string;
|
|
4
5
|
delay?: number;
|
|
5
6
|
className?: string;
|
|
6
7
|
style?: CSSProperties;
|
|
7
8
|
variant?: 'contained' | 'outlined' | 'text';
|
|
8
9
|
}
|
|
9
|
-
export default function Feedback({ application, delay, className, style, variant }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function Feedback({ application, apiUrl, delay, className, style, variant }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as S, Fragment as T } from "react/jsx-runtime";
|
|
2
2
|
import "../../state/webrtcState.js";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTranslation as
|
|
3
|
+
import { useState as r, useEffect as g } from "react";
|
|
4
|
+
import { useTranslation as w } from "react-i18next";
|
|
5
5
|
import "../../hooks/peer.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as F } from "../Button/Button.js";
|
|
7
7
|
import "../../index-SOhdqzHq.js";
|
|
8
8
|
import "../../style/theme.js";
|
|
9
9
|
import "../../util/canvas.js";
|
|
@@ -16,48 +16,53 @@ import "../WorkflowLayout/svgContext.js";
|
|
|
16
16
|
import "../WorkflowLayout/Widget.js";
|
|
17
17
|
import "../IconMenu/context.js";
|
|
18
18
|
import "@emotion/react";
|
|
19
|
-
import
|
|
20
|
-
import { c as
|
|
21
|
-
const
|
|
19
|
+
import I from "./FeedbackForm.js";
|
|
20
|
+
import { c as v } from "../../createSvgIcon-BM4dw4Lw.js";
|
|
21
|
+
const j = v(/* @__PURE__ */ t("path", {
|
|
22
22
|
d: "M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5"
|
|
23
23
|
}), "ThumbsUpDown");
|
|
24
|
-
function
|
|
25
|
-
const { t:
|
|
26
|
-
return
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
24
|
+
function R({ application: s, apiUrl: o, delay: n, className: a, style: p, variant: u }) {
|
|
25
|
+
const { t: f } = w(), [l, c] = r(!1), [d, h] = r(""), [b, m] = r(!1), i = localStorage.getItem("feedbackSubmitted") === "true";
|
|
26
|
+
return g(() => {
|
|
27
|
+
if (!i) {
|
|
28
|
+
const k = setTimeout(
|
|
29
29
|
() => {
|
|
30
|
+
o && fetch(`${o}`).then((e) => e.json()).then((e) => {
|
|
31
|
+
h(e.token), c(!0);
|
|
32
|
+
}).catch(() => {
|
|
33
|
+
console.warn("Feedback denied");
|
|
34
|
+
});
|
|
30
35
|
},
|
|
31
|
-
|
|
36
|
+
n ?? 3e5
|
|
32
37
|
);
|
|
33
|
-
return () => clearTimeout(
|
|
38
|
+
return () => clearTimeout(k);
|
|
34
39
|
}
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
}, [i, n, o]), /* @__PURE__ */ S(T, { children: [
|
|
41
|
+
l && /* @__PURE__ */ t(
|
|
42
|
+
F,
|
|
38
43
|
{
|
|
39
|
-
variant:
|
|
40
|
-
onClick: () =>
|
|
41
|
-
className:
|
|
42
|
-
style:
|
|
43
|
-
startIcon: /* @__PURE__ */ t(
|
|
44
|
-
children:
|
|
44
|
+
variant: u ?? "contained",
|
|
45
|
+
onClick: () => m(!0),
|
|
46
|
+
className: a,
|
|
47
|
+
style: p,
|
|
48
|
+
startIcon: /* @__PURE__ */ t(j, {}),
|
|
49
|
+
children: f("feedback.button")
|
|
45
50
|
}
|
|
46
51
|
),
|
|
47
52
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
53
|
+
I,
|
|
49
54
|
{
|
|
50
|
-
open:
|
|
51
|
-
onClose: () =>
|
|
55
|
+
open: b,
|
|
56
|
+
onClose: () => m(!1),
|
|
52
57
|
onDone: () => {
|
|
53
|
-
localStorage.setItem("feedbackSubmitted", "true"),
|
|
58
|
+
localStorage.setItem("feedbackSubmitted", "true"), c(!1);
|
|
54
59
|
},
|
|
55
|
-
token:
|
|
56
|
-
application:
|
|
60
|
+
token: d,
|
|
61
|
+
application: s
|
|
57
62
|
}
|
|
58
63
|
)
|
|
59
64
|
] });
|
|
60
65
|
}
|
|
61
66
|
export {
|
|
62
|
-
|
|
67
|
+
R as default
|
|
63
68
|
};
|