code7-leia 0.2.37 → 1.0.0
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/README.md +107 -1
- package/dist/code7-leia.cjs.development.js +1 -1
- 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 +1 -1
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/components/CustomToast/styles.d.ts +1 -1
- package/dist/components/EmptyState/styles.d.ts +1 -2
- package/dist/components/FileArea/components/AreaUpload/styles.d.ts +2 -3
- package/dist/components/FileArea/components/Modal/styles.d.ts +8 -9
- package/dist/components/FileArea/components/Search/styles.d.ts +3 -4
- package/dist/components/FileArea/components/Spinner/styles.d.ts +1 -2
- package/dist/components/FileArea/components/Table/styles.d.ts +3 -4
- package/dist/components/FileArea/styles.d.ts +2 -3
- package/dist/components/MultiSelect/styles.d.ts +7 -8
- package/dist/components/Select/styles.d.ts +1 -2
- package/dist/components/Tabs/styles.d.ts +4 -4
- package/dist/components/TestArea/components/InputTest/styles.d.ts +3 -4
- package/dist/components/TestArea/components/TextArea/styles.d.ts +6 -7
- package/dist/components/TestArea/styles.d.ts +4 -5
- package/package.json +35 -70
- package/src/Leia.tsx +0 -44
- package/src/components/CustomToast/index.tsx +0 -62
- package/src/components/CustomToast/styles.tsx +0 -73
- package/src/components/EmptyState/index.tsx +0 -88
- package/src/components/EmptyState/styles.tsx +0 -81
- package/src/components/FileArea/components/AreaUpload/index.tsx +0 -137
- package/src/components/FileArea/components/AreaUpload/styles.tsx +0 -75
- package/src/components/FileArea/components/Modal/ModalButtonClose.tsx +0 -23
- package/src/components/FileArea/components/Modal/ModalContent.tsx +0 -26
- package/src/components/FileArea/components/Modal/ModalFooter.tsx +0 -18
- package/src/components/FileArea/components/Modal/ModalHeader.tsx +0 -18
- package/src/components/FileArea/components/Modal/ModalTitle.tsx +0 -18
- package/src/components/FileArea/components/Modal/index.tsx +0 -131
- package/src/components/FileArea/components/Modal/styles.tsx +0 -121
- package/src/components/FileArea/components/Search/index.tsx +0 -44
- package/src/components/FileArea/components/Search/styles.tsx +0 -26
- package/src/components/FileArea/components/Spinner/index.tsx +0 -22
- package/src/components/FileArea/components/Spinner/styles.tsx +0 -59
- package/src/components/FileArea/components/Table/index.tsx +0 -34
- package/src/components/FileArea/components/Table/styles.tsx +0 -60
- package/src/components/FileArea/index.tsx +0 -281
- package/src/components/FileArea/styles.tsx +0 -183
- package/src/components/MultiSelect/index.tsx +0 -102
- package/src/components/MultiSelect/styles.tsx +0 -77
- package/src/components/Select/index.tsx +0 -53
- package/src/components/Select/styles.tsx +0 -49
- package/src/components/Tabs/index.tsx +0 -71
- package/src/components/Tabs/styles.tsx +0 -87
- package/src/components/TestArea/components/InputTest/index.tsx +0 -21
- package/src/components/TestArea/components/InputTest/styles.tsx +0 -28
- package/src/components/TestArea/components/TextArea/index.tsx +0 -97
- package/src/components/TestArea/components/TextArea/styles.tsx +0 -171
- package/src/components/TestArea/index.tsx +0 -101
- package/src/components/TestArea/styles.tsx +0 -112
- package/src/contexts/SharedPropsProvider.tsx +0 -79
- package/src/index.tsx +0 -20
- package/src/interface/FileData.ts +0 -11
- package/src/interface/Language.ts +0 -93
- package/src/interface/Table.ts +0 -12
- package/src/service/Api.ts +0 -9
- package/src/service/ApiDev.ts +0 -9
- package/src/service/ApiHml.ts +0 -9
- package/src/store/index.ts +0 -13
- package/src/store/modules/actions.ts +0 -88
- package/src/store/modules/reducer.ts +0 -46
- package/src/store/modules/sagas.ts +0 -127
- package/src/store/modules/types.ts +0 -19
- package/src/types/image.d.ts +0 -4
- package/src/utils/formatAxios.tsx +0 -15
- package/src/utils/getApi.tsx +0 -16
- package/src/utils/getLanguage.tsx +0 -17
- package/src/utils/languages/en.ts +0 -87
- package/src/utils/languages/es.ts +0 -87
- package/src/utils/languages/pt-br.ts +0 -87
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const InputContainer = styled.div`
|
|
4
|
-
position: relative;
|
|
5
|
-
width: 300px;
|
|
6
|
-
`;
|
|
7
|
-
|
|
8
|
-
export const Input = styled.input`
|
|
9
|
-
padding-left: 40px;
|
|
10
|
-
border-radius: 5px;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
height: 45px;
|
|
13
|
-
width: 100%;
|
|
14
|
-
|
|
15
|
-
&:focus {
|
|
16
|
-
outline: none;
|
|
17
|
-
box-shadow: 0 0 0 3px #6690ff;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
export const IconContainer = styled.div`
|
|
22
|
-
position: absolute;
|
|
23
|
-
top: 14px;
|
|
24
|
-
left: 10px;
|
|
25
|
-
pointer-events: none;
|
|
26
|
-
`;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import cc from 'classcat';
|
|
3
|
-
|
|
4
|
-
import * as S from './styles';
|
|
5
|
-
|
|
6
|
-
import { SpinnerProps } from '../../../../interface/Table'
|
|
7
|
-
|
|
8
|
-
const Spinner: React.FC<SpinnerProps> = ({ color = 'neutral-3', size = 'md', className }) => {
|
|
9
|
-
return (
|
|
10
|
-
<S.SpinnerWrapper
|
|
11
|
-
color={color}
|
|
12
|
-
className={cc([`spinner--${size}`, className])}
|
|
13
|
-
>
|
|
14
|
-
<span />
|
|
15
|
-
<span />
|
|
16
|
-
<span />
|
|
17
|
-
<span />
|
|
18
|
-
</S.SpinnerWrapper>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default Spinner;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const SpinnerWrapper = styled.span`
|
|
4
|
-
display: inline-block;
|
|
5
|
-
position: relative;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
|
|
10
|
-
&.spinner--sm {
|
|
11
|
-
width: 24px;
|
|
12
|
-
height: 24px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.spinner--md {
|
|
16
|
-
width: 32px;
|
|
17
|
-
height: 32px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.spinner--lg {
|
|
21
|
-
width: 60px;
|
|
22
|
-
height: 60px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
span {
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
display: block;
|
|
28
|
-
position: absolute;
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
|
-
margin: 8px;
|
|
32
|
-
border: 4px solid #fff;
|
|
33
|
-
border-radius: 50%;
|
|
34
|
-
animation: rotateSpinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
35
|
-
border-color: ${(props) => `var(--${props.color})`} transparent transparent
|
|
36
|
-
transparent;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
& span:nth-child(1) {
|
|
40
|
-
animation-delay: -0.45s;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
& span:nth-child(2) {
|
|
44
|
-
animation-delay: -0.3s;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
& span:nth-child(3) {
|
|
48
|
-
animation-delay: -0.15s;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@keyframes rotateSpinner {
|
|
52
|
-
0% {
|
|
53
|
-
transform: rotate(0deg);
|
|
54
|
-
}
|
|
55
|
-
100% {
|
|
56
|
-
transform: rotate(360deg);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, Ref } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cc from 'classcat';
|
|
4
|
-
|
|
5
|
-
import * as S from './styles';
|
|
6
|
-
import Spinner from '../Spinner';
|
|
7
|
-
|
|
8
|
-
import { TableProps } from '../../../../interface/Table'
|
|
9
|
-
|
|
10
|
-
const Table = forwardRef(
|
|
11
|
-
({ size = 'medium', children, isloading = false, className = '', ...props }: TableProps, ref: Ref<HTMLTableElement>) => {
|
|
12
|
-
return (
|
|
13
|
-
<S.TableWrapper className={className}>
|
|
14
|
-
{isloading ? (
|
|
15
|
-
<S.TableLoadingWrapper>
|
|
16
|
-
<Spinner />
|
|
17
|
-
</S.TableLoadingWrapper>
|
|
18
|
-
) : null}
|
|
19
|
-
<S.Table className={cc([size])} ref={ref} {...props}>
|
|
20
|
-
{children}
|
|
21
|
-
</S.Table>
|
|
22
|
-
</S.TableWrapper>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
Table.propTypes = {
|
|
28
|
-
children: PropTypes.node.isRequired,
|
|
29
|
-
className: PropTypes.string,
|
|
30
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
31
|
-
isloading: PropTypes.bool,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default Table;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const TableWrapper = styled.div`
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: max-content;
|
|
6
|
-
min-height: 50px;
|
|
7
|
-
position: relative;
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
export const Table = styled.table`
|
|
11
|
-
font-size: 14px;
|
|
12
|
-
line-height: 143%;
|
|
13
|
-
color: black;
|
|
14
|
-
width: 100%;
|
|
15
|
-
border-collapse: collapse;
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
|
|
18
|
-
th {
|
|
19
|
-
font-weight: 600;
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
line-height: 143%;
|
|
22
|
-
letter-spacing: 0.018em;
|
|
23
|
-
color: #5A5D68;
|
|
24
|
-
text-align: left;
|
|
25
|
-
padding: 8px;
|
|
26
|
-
border: 1px #dadce3 solid;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
thead tr {
|
|
30
|
-
background: #dadce3;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
tbody tr {
|
|
34
|
-
border: 1px solid #dadce3;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.small td {
|
|
38
|
-
padding: 4px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.medium td {
|
|
42
|
-
padding: 8px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&.large td {
|
|
46
|
-
padding: 16px;
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
|
|
50
|
-
export const TableLoadingWrapper = styled.div`
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 0;
|
|
53
|
-
left: 0;
|
|
54
|
-
bottom: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
display: flex;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
align-items: center;
|
|
59
|
-
background-color: #f3f5f961;
|
|
60
|
-
`;
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState} from 'react';
|
|
2
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
-
import { renderToString } from 'react-dom/server';
|
|
4
|
-
|
|
5
|
-
import { FaUpload, FaList, FaCheck, FaFile } from 'react-icons/fa';
|
|
6
|
-
import { GiWeightLiftingUp } from "react-icons/gi";
|
|
7
|
-
import { TiDelete } from "react-icons/ti";
|
|
8
|
-
|
|
9
|
-
import type { FileData, tag } from '../../interface/FileData'
|
|
10
|
-
|
|
11
|
-
import { getLanguage } from '../../utils/getLanguage'
|
|
12
|
-
|
|
13
|
-
import * as S from './styles';
|
|
14
|
-
import Table from './components/Table';
|
|
15
|
-
import Search from './components/Search';
|
|
16
|
-
import Modal from './components/Modal'
|
|
17
|
-
import ModalFooter from './components/Modal/ModalFooter'
|
|
18
|
-
import ModalContent from './components/Modal/ModalContent'
|
|
19
|
-
import EmptyState from '../EmptyState';
|
|
20
|
-
import MultiSelect from '../MultiSelect';
|
|
21
|
-
import AreaUpload from './components/AreaUpload';
|
|
22
|
-
import { SharedPropsProvider, useSharedProps } from '../../contexts/SharedPropsProvider';
|
|
23
|
-
import { deleteFilesAction, getFilesAction, uploadFilesAction, trainingAction } from '../../store/modules/actions';
|
|
24
|
-
|
|
25
|
-
export const FileArea = () => {
|
|
26
|
-
const { id, language, propTags, token, env, readonly } = useSharedProps();
|
|
27
|
-
const [files, setFiles] = useState<FileData[]>([]);
|
|
28
|
-
const [initialFiles, setInitialFiles] = useState<FileData[]>([]);
|
|
29
|
-
const [uploadFile, setUploadFile] = useState<{ content: ArrayBuffer | string; properties: File }>();
|
|
30
|
-
const [modal, setModal] = useState(false)
|
|
31
|
-
const [modalDelete, setModalDelete] = useState(false)
|
|
32
|
-
const [modalTraining, setModalTraining] = useState(false)
|
|
33
|
-
const [fileDelete, setFileDelete] = useState('')
|
|
34
|
-
const [optionsPresset, setOptionsPresset] = useState<{ label: any; value: any; }[]>([])
|
|
35
|
-
const [presset, setPresset] = useState<string[]>([]);
|
|
36
|
-
const t = getLanguage(language)
|
|
37
|
-
const dispatch = useDispatch();
|
|
38
|
-
const initFiles = useSelector((state: any) => state.files);
|
|
39
|
-
const isloading = useSelector((state: any) => state.isloading);
|
|
40
|
-
const tags = propTags ? propTags.tags : [];
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
dispatch(getFilesAction(id, token, env))
|
|
44
|
-
}, [id])
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if(tags.length > 0){
|
|
48
|
-
const options = tags.map((tag: any) => {
|
|
49
|
-
return { label: tag, value: tag }
|
|
50
|
-
})
|
|
51
|
-
setOptionsPresset(options)
|
|
52
|
-
}else if(optionsPresset.length > 0){
|
|
53
|
-
setOptionsPresset([])
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}, [tags])
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if(!modal){
|
|
60
|
-
const options = tags.map((tag: any) => {
|
|
61
|
-
return { label: tag, value: tag }
|
|
62
|
-
})
|
|
63
|
-
setOptionsPresset(options)
|
|
64
|
-
}
|
|
65
|
-
}, [modal])
|
|
66
|
-
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if(!!initFiles){
|
|
69
|
-
setFiles(initFiles)
|
|
70
|
-
setInitialFiles(initFiles)
|
|
71
|
-
}
|
|
72
|
-
}, [initFiles])
|
|
73
|
-
|
|
74
|
-
const pressetTag = (tags: [tag]) => {
|
|
75
|
-
let html = '';
|
|
76
|
-
|
|
77
|
-
html += tags.map(tag => {
|
|
78
|
-
const checkIcon = tag.trained ? '' : renderToString(<TiDelete size={14} />);
|
|
79
|
-
const tagClass = tag.trained ? 'trained' : '';
|
|
80
|
-
return `<p class='tag ${tagClass}'>${tag.name} ${checkIcon}</p>`;
|
|
81
|
-
}).join('');
|
|
82
|
-
|
|
83
|
-
return html;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const handleOpenModal = () => {
|
|
87
|
-
if(modal){
|
|
88
|
-
setUploadFile(undefined)
|
|
89
|
-
setPresset([])
|
|
90
|
-
}
|
|
91
|
-
setModal(!modal)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const handleOpenModalDelete = (name: string) => {
|
|
95
|
-
setFileDelete(name)
|
|
96
|
-
setModalDelete(!modalDelete)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const handleOpenModalTraining = (tags?: [tag]) => {
|
|
100
|
-
let pressets: string[] = []
|
|
101
|
-
tags?.map((tag) => {
|
|
102
|
-
if(!tag.trained){
|
|
103
|
-
pressets.push(tag.name)
|
|
104
|
-
}
|
|
105
|
-
})
|
|
106
|
-
setPresset(pressets)
|
|
107
|
-
setModalTraining(!modalTraining)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const deleteFile = () => {
|
|
111
|
-
dispatch(deleteFilesAction(fileDelete, id, language, token, env))
|
|
112
|
-
setModalDelete(false)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const handleUploadFile = () => {
|
|
116
|
-
dispatch(uploadFilesAction(uploadFile, id, presset, language, token, env))
|
|
117
|
-
setModal(false)
|
|
118
|
-
setUploadFile(undefined)
|
|
119
|
-
setPresset([])
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const handleTrain = () => {
|
|
123
|
-
dispatch(trainingAction(id, presset, language, token, env))
|
|
124
|
-
setModalTraining(false)
|
|
125
|
-
setPresset([])
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const viewFile = (link: string, name: string) => {
|
|
129
|
-
if(link){
|
|
130
|
-
const checkIcon = renderToString(<FaFile size={14} />);
|
|
131
|
-
return `<a href='${link}' target='_blank'>${checkIcon}</a> ${name}`;
|
|
132
|
-
}
|
|
133
|
-
return name
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const renderFiles = () => {
|
|
137
|
-
return (
|
|
138
|
-
<S.Container isloading={isloading}>
|
|
139
|
-
<div id='loading' />
|
|
140
|
-
<S.Header>
|
|
141
|
-
<div className='infos'>
|
|
142
|
-
<h2>{t.files}</h2>
|
|
143
|
-
<p>{t.fileArea.description}</p>
|
|
144
|
-
</div>
|
|
145
|
-
<div className='actions'>
|
|
146
|
-
<Search placeholder={t.fileArea.search} setFiles={setFiles} initialFiles={initialFiles}></Search>
|
|
147
|
-
<div>
|
|
148
|
-
<button id='button-upload' disabled={readonly} onClick={handleOpenModal}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>
|
|
149
|
-
<button disabled={readonly} onClick={() => handleOpenModalTraining(undefined)} ><GiWeightLiftingUp size={14} /> {t.fileArea.training}</button>
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
</S.Header>
|
|
153
|
-
{
|
|
154
|
-
files.length === 0 ? (
|
|
155
|
-
<EmptyState
|
|
156
|
-
icon={<FaList></FaList>}
|
|
157
|
-
title={t.fileArea.emptyState.title}
|
|
158
|
-
description={t.fileArea.emptyState.description}
|
|
159
|
-
iconButton={<button id='button-upload' disabled={readonly} onClick={handleOpenModal}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>}
|
|
160
|
-
descriptionButton={t.fileArea.fileUpload}
|
|
161
|
-
widthButton="230px"
|
|
162
|
-
/>
|
|
163
|
-
) : <Table>
|
|
164
|
-
<thead>
|
|
165
|
-
<tr>
|
|
166
|
-
<th key="th_file_name" className="th_file_name">
|
|
167
|
-
{t.fileArea.fileName}
|
|
168
|
-
</th>
|
|
169
|
-
<th key="th_file_name" className="th_status">
|
|
170
|
-
{t.fileArea.status}
|
|
171
|
-
</th>
|
|
172
|
-
<th key="th_pressets" className="th_pressets">
|
|
173
|
-
{t.fileArea.presset}
|
|
174
|
-
</th>
|
|
175
|
-
<th key="th_actions" className="th_actions">
|
|
176
|
-
{t.fileArea.actions}
|
|
177
|
-
</th>
|
|
178
|
-
</tr>
|
|
179
|
-
</thead>
|
|
180
|
-
|
|
181
|
-
<tbody>
|
|
182
|
-
{files.map((object) => (
|
|
183
|
-
<tr>
|
|
184
|
-
<td dangerouslySetInnerHTML={{ __html: viewFile(object.link, object.name) }} />
|
|
185
|
-
<td>{object.trained ? <FaCheck size={14} style={{ color: 'green' }} /> : <TiDelete size={14} style={{ color: 'red' }} />}</td>
|
|
186
|
-
<td className='tags' dangerouslySetInnerHTML={{ __html: pressetTag(object.tags) }} />
|
|
187
|
-
<td>
|
|
188
|
-
<div className='divDelete'>
|
|
189
|
-
<button className='buttonTraining' disabled={readonly} onClick={() => handleOpenModalTraining(object.tags)}>{t.buttons.training}</button>
|
|
190
|
-
<button className='buttonDelete' disabled={readonly} onClick={() => handleOpenModalDelete(object.name)}>{t.buttons.delete}</button>
|
|
191
|
-
</div>
|
|
192
|
-
</td>
|
|
193
|
-
</tr>
|
|
194
|
-
))}
|
|
195
|
-
</tbody>
|
|
196
|
-
</Table>
|
|
197
|
-
}
|
|
198
|
-
<Modal
|
|
199
|
-
isopen={modal}
|
|
200
|
-
maxwidth="600px"
|
|
201
|
-
maxheight="max-content"
|
|
202
|
-
onClose={handleOpenModal}
|
|
203
|
-
title={t.fileArea.modal.uploadFile}
|
|
204
|
-
>
|
|
205
|
-
<ModalContent>
|
|
206
|
-
<div className='choose-file'>
|
|
207
|
-
<AreaUpload
|
|
208
|
-
setFile={setUploadFile}
|
|
209
|
-
file={uploadFile?.properties.name}
|
|
210
|
-
/>
|
|
211
|
-
</div>
|
|
212
|
-
<div className='presset'>
|
|
213
|
-
<p>{t.fileArea.presset}</p>
|
|
214
|
-
<MultiSelect setOptions={setOptionsPresset} options={optionsPresset} presset={presset} setPresset={setPresset} modal={modal} language={language} hasAddNewOptions={true} />
|
|
215
|
-
</div>
|
|
216
|
-
</ModalContent>
|
|
217
|
-
<ModalFooter>
|
|
218
|
-
<button className='button cancel' onClick={handleOpenModal}>
|
|
219
|
-
{t.buttons.cancel}
|
|
220
|
-
</button>
|
|
221
|
-
<button onClick={() => handleUploadFile()} className='button send' type="submit" form="form-tts">
|
|
222
|
-
{t.buttons.send}
|
|
223
|
-
</button>
|
|
224
|
-
</ModalFooter>
|
|
225
|
-
|
|
226
|
-
</Modal>
|
|
227
|
-
<Modal
|
|
228
|
-
isopen={modalDelete}
|
|
229
|
-
maxwidth="600px"
|
|
230
|
-
maxheight="max-content"
|
|
231
|
-
onClose={() => handleOpenModalDelete('')}
|
|
232
|
-
title={t.fileArea.modal.deleteFileTitle}
|
|
233
|
-
>
|
|
234
|
-
<ModalContent>
|
|
235
|
-
<p id='warning'>{t.fileArea.modal.deleteFile}</p>
|
|
236
|
-
</ModalContent>
|
|
237
|
-
<ModalFooter>
|
|
238
|
-
<button className='button cancel' onClick={() => handleOpenModalDelete('')}>
|
|
239
|
-
{t.buttons.cancel}
|
|
240
|
-
</button>
|
|
241
|
-
<button className='button delete' type="submit" form="form-tts" onClick={deleteFile}>
|
|
242
|
-
{t.buttons.delete}
|
|
243
|
-
</button>
|
|
244
|
-
</ModalFooter>
|
|
245
|
-
</Modal>
|
|
246
|
-
<Modal
|
|
247
|
-
isopen={modalTraining}
|
|
248
|
-
maxwidth="600px"
|
|
249
|
-
maxheight="max-content"
|
|
250
|
-
onClose={() => handleOpenModalTraining(undefined)}
|
|
251
|
-
title={t.fileArea.modal.trainingTitle}
|
|
252
|
-
>
|
|
253
|
-
<ModalContent>
|
|
254
|
-
<p id='info'>{t.fileArea.modal.trainingDescription}</p>
|
|
255
|
-
<div className='presset'>
|
|
256
|
-
<p>{t.fileArea.presset}</p>
|
|
257
|
-
<MultiSelect setOptions={setOptionsPresset} options={optionsPresset} presset={presset} setPresset={setPresset} modal={modal} language={language} hasAddNewOptions={false} />
|
|
258
|
-
</div>
|
|
259
|
-
</ModalContent>
|
|
260
|
-
<ModalFooter>
|
|
261
|
-
<button className='button cancel' onClick={() => handleOpenModalTraining(undefined)}>
|
|
262
|
-
{t.buttons.cancel}
|
|
263
|
-
</button>
|
|
264
|
-
<button onClick={() => handleTrain()} className='button send' type="submit" form="form-tts">
|
|
265
|
-
{t.buttons.send}
|
|
266
|
-
</button>
|
|
267
|
-
</ModalFooter>
|
|
268
|
-
|
|
269
|
-
</Modal>
|
|
270
|
-
</S.Container>
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return (
|
|
275
|
-
<SharedPropsProvider readonly={readonly} id={id} language={language} token={token} env={env} propTags={{ tags: [] }} personas={[{name: '', description: ''}]}>
|
|
276
|
-
<S.Container>
|
|
277
|
-
{renderFiles()}
|
|
278
|
-
</S.Container>
|
|
279
|
-
</SharedPropsProvider>
|
|
280
|
-
);
|
|
281
|
-
};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
interface ContainerProps {
|
|
4
|
-
isloading?: boolean;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const Container = styled.div<ContainerProps>`
|
|
8
|
-
${(props) =>
|
|
9
|
-
props.isloading &&
|
|
10
|
-
css`
|
|
11
|
-
#loading {
|
|
12
|
-
position: fixed;
|
|
13
|
-
top: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
background-color: rgb(151,154,165, 0.7);
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
z-index: 9999;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#loading::after {
|
|
25
|
-
content: "";
|
|
26
|
-
border: 4px solid #f3f3f3; /* Cor do símbolo de carregamento */
|
|
27
|
-
border-top: 4px solid #5a5d68; /* Cor do símbolo de carregamento */
|
|
28
|
-
border-radius: 50%;
|
|
29
|
-
width: 13px;
|
|
30
|
-
height: 13px;
|
|
31
|
-
animation: spin 1s linear infinite;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@keyframes spin {
|
|
35
|
-
0% { transform: rotate(0deg); }
|
|
36
|
-
100% { transform: rotate(360deg); }
|
|
37
|
-
}
|
|
38
|
-
`}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.tag {
|
|
42
|
-
padding: 4px 8px 4px 8px;
|
|
43
|
-
background: #C7F9ED;
|
|
44
|
-
border-radius: 4px;
|
|
45
|
-
display: flex;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
align-items: center;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.tags {
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: left;
|
|
53
|
-
gap: 4px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.divDelete {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: flex-start;
|
|
60
|
-
gap: 4px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.buttonDelete {
|
|
64
|
-
color: #5b0a1f;
|
|
65
|
-
background: #fae0d2;
|
|
66
|
-
padding: 12px 20px;
|
|
67
|
-
border-radius: 4px;
|
|
68
|
-
|
|
69
|
-
&:disabled {
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
opacity: 0.7;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.buttonDelete:hover {
|
|
76
|
-
background: #f5bba7;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.buttonTraining {
|
|
80
|
-
color: #023906;
|
|
81
|
-
background: #e3f8cc;
|
|
82
|
-
padding: 12px 20px;
|
|
83
|
-
border-radius: 4px;
|
|
84
|
-
margin-right: 10px;
|
|
85
|
-
|
|
86
|
-
&:disabled {
|
|
87
|
-
cursor: not-allowed;
|
|
88
|
-
opacity: 0.7;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.buttonTraining:hover {
|
|
93
|
-
background: #90d665;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.button {
|
|
97
|
-
padding: 8px 16px 8px 16px;
|
|
98
|
-
border-radius: 4px;
|
|
99
|
-
gap: 10px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.cancel {
|
|
103
|
-
background: #F3F5F9;
|
|
104
|
-
color: #5A5D68;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.send {
|
|
108
|
-
background: #102693;
|
|
109
|
-
color: white;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.delete {
|
|
113
|
-
background: #871821;
|
|
114
|
-
color: white;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.presset {
|
|
118
|
-
padding-top: 10px;
|
|
119
|
-
display: flex;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
|
|
122
|
-
p {
|
|
123
|
-
font-size: 14px;
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
padding: 4px 0;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
#warning {
|
|
130
|
-
padding: 10px;
|
|
131
|
-
background: #FAE0D2;
|
|
132
|
-
color: #871821;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
#info {
|
|
136
|
-
padding: 10px;
|
|
137
|
-
background: #c7f9ed;
|
|
138
|
-
color: #00344e;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
`;
|
|
142
|
-
|
|
143
|
-
export const Header = styled.div`
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
|
|
147
|
-
#button-upload {
|
|
148
|
-
margin-right: 10px;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.infos {
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
padding: 14px 0;
|
|
155
|
-
|
|
156
|
-
h2 {
|
|
157
|
-
font-size: 20px
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
p {
|
|
161
|
-
font-size: 14px
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.actions {
|
|
166
|
-
display: flex;
|
|
167
|
-
justify-content: space-between;
|
|
168
|
-
padding-bottom: 14px;
|
|
169
|
-
|
|
170
|
-
button {
|
|
171
|
-
background: #102693;
|
|
172
|
-
padding: 10px 20px;
|
|
173
|
-
color: white;
|
|
174
|
-
border-radius: 4px;
|
|
175
|
-
|
|
176
|
-
&:disabled {
|
|
177
|
-
cursor: not-allowed;
|
|
178
|
-
opacity: 0.7;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
`
|