code7-leia 0.2.22 → 0.2.24
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/dist/code7-leia.cjs.development.js +60 -34
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +60 -34
- package/dist/code7-leia.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TestArea/components/TextArea/styles.tsx +5 -3
- package/src/components/TestArea/index.tsx +1 -1
- package/src/contexts/SharedPropsProvider.tsx +4 -3
package/package.json
CHANGED
|
@@ -14,6 +14,8 @@ export const InputWrapper = styled.div`
|
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
position: relative;
|
|
17
|
+
margin-right: 5px;
|
|
18
|
+
width: 300px;
|
|
17
19
|
|
|
18
20
|
.icon {
|
|
19
21
|
position: absolute;
|
|
@@ -100,15 +102,15 @@ export const CustomTextArea = styled.textarea`
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
&.small {
|
|
103
|
-
|
|
105
|
+
height: 32px;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
&.medium {
|
|
107
|
-
|
|
109
|
+
height: 45px;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
&.large {
|
|
111
|
-
|
|
113
|
+
height: 48px;
|
|
112
114
|
font-size: 1rem;
|
|
113
115
|
}
|
|
114
116
|
|
|
@@ -66,7 +66,7 @@ export const TestArea = () => {
|
|
|
66
66
|
<S.Inputs>
|
|
67
67
|
<InputTest placeholder={t.testArea.typeSentence} onChange={handleSearch} />
|
|
68
68
|
<Select placeholder={t.testArea.selectPersona} options={optionsPersona} onSelect={handleSelectPersona} />
|
|
69
|
-
{profile === "Custom" && <TextArea className="textarea-message"
|
|
69
|
+
{profile === "Custom" && <TextArea className="textarea-message" placeholder={t.testArea.typePrompt} value={prompt} onChange={(e) => { handlePrompt(e.target.value); }} />}
|
|
70
70
|
<Select placeholder={t.testArea.selectPresset} options={optionsPresset} onSelect={handleSelectPresset} />
|
|
71
71
|
<button onClick={handleTest}><PiWaveformBold /> {t.buttons.test}</button>
|
|
72
72
|
</S.Inputs>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
2
2
|
import api from '../service/Api';
|
|
3
|
+
import apiHml from '../service/ApiHml';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
id: string;
|
|
@@ -26,14 +27,14 @@ export const useSharedProps = () => {
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export const SharedPropsProvider: React.FC<Props> = ({ children, ...props }) => {
|
|
29
|
-
const { id, language } = props;
|
|
30
|
+
const { id, language, env } = props;
|
|
30
31
|
const [tags, setTags] = useState<any>(null);
|
|
31
32
|
const [personas, setPersonas] = useState<any>(null);
|
|
32
33
|
|
|
33
34
|
useEffect(() => {
|
|
34
35
|
const fetchData = async () => {
|
|
35
36
|
try {
|
|
36
|
-
const { data } = await api.get(`/tags/${id}`);
|
|
37
|
+
const { data } = env.toLowerCase() === 'prod' ? await api.get(`/tags/${id}`) : await apiHml.get(`/tags/${id}`);
|
|
37
38
|
|
|
38
39
|
if (data) {
|
|
39
40
|
setTags(data);
|
|
@@ -47,7 +48,7 @@ export const SharedPropsProvider: React.FC<Props> = ({ children, ...props }) =>
|
|
|
47
48
|
|
|
48
49
|
const personas = async () => {
|
|
49
50
|
try {
|
|
50
|
-
const { data } = await api.get(`/personas?language=${language}`);
|
|
51
|
+
const { data } = env.toLowerCase() === 'prod' ? await api.get(`/personas?language=${language}`) : await apiHml.get(`/personas?language=${language}`);
|
|
51
52
|
|
|
52
53
|
if (data) {
|
|
53
54
|
setPersonas(data);
|