code7-leia 0.1.166 → 0.1.168
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 +10 -4
- 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 +10 -4
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/interface/FileData.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/FileArea/index.tsx +8 -5
- package/src/components/FileArea/styles.tsx +4 -0
- package/src/interface/FileData.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState} from 'react';
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
+
import { renderToString } from 'react-dom/server';
|
|
3
4
|
|
|
4
5
|
import { FaUpload, FaList, FaPlus, FaCheck } from 'react-icons/fa';
|
|
5
6
|
import { GiWeightLiftingUp } from "react-icons/gi";
|
|
@@ -71,11 +72,13 @@ export const FileArea = () => {
|
|
|
71
72
|
|
|
72
73
|
const pressetTag = (tags: [tag]) => {
|
|
73
74
|
let html = '';
|
|
74
|
-
|
|
75
|
+
|
|
75
76
|
html += tags.map(tag => {
|
|
76
|
-
|
|
77
|
+
const checkIcon = tag.trained ? renderToString(<FaCheck size={14} />) : '';
|
|
78
|
+
const tagClass = tag.trained ? 'trained' : '';
|
|
79
|
+
return `<p class='tag ${tagClass}'>${tag.name} ${checkIcon}</p>`;
|
|
77
80
|
}).join('');
|
|
78
|
-
|
|
81
|
+
|
|
79
82
|
return html;
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -124,7 +127,7 @@ export const FileArea = () => {
|
|
|
124
127
|
<div className='actions'>
|
|
125
128
|
<Search placeholder={t.fileArea.search} setFiles={setFiles} initialFiles={initialFiles}></Search>
|
|
126
129
|
<div>
|
|
127
|
-
<button onClick={handleOpenModal}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>
|
|
130
|
+
<button id='button-upload' onClick={handleOpenModal}><FaUpload size={14} /> {t.fileArea.fileUpload}</button>
|
|
128
131
|
<button onClick={() => handleOpenModalTraining(undefined)}><GiWeightLiftingUp size={14} /> {t.fileArea.training}</button>
|
|
129
132
|
</div>
|
|
130
133
|
</div>
|
|
@@ -158,7 +161,7 @@ export const FileArea = () => {
|
|
|
158
161
|
<tbody>
|
|
159
162
|
{files.map((object) => (
|
|
160
163
|
<tr>
|
|
161
|
-
<td>{object.name}</td>
|
|
164
|
+
<td>{object.name} {object.trained ? <FaCheck size={14} /> : ''}</td>
|
|
162
165
|
<td className='tags' dangerouslySetInnerHTML={{ __html: pressetTag(object.tags) }} />
|
|
163
166
|
<td>
|
|
164
167
|
<div className='divDelete'>
|