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.
@@ -5,4 +5,5 @@ export interface tag {
5
5
  export interface FileData {
6
6
  name: string;
7
7
  tags: [tag];
8
+ trained: boolean;
8
9
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.166",
2
+ "version": "0.1.168",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -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
- return `<p class='tag ${tag.trained ? 'trained' : ''}'>${tag.name} ${tag.trained ? <FaCheck size={14} /> : ''}</p>`;
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'>
@@ -131,6 +131,10 @@ export const Header = styled.div`
131
131
  display: flex;
132
132
  flex-direction: column;
133
133
 
134
+ #button-upload {
135
+ margin-right: 10px;
136
+ }
137
+
134
138
  .infos {
135
139
  display: flex;
136
140
  flex-direction: column;
@@ -6,4 +6,5 @@ export interface tag {
6
6
  export interface FileData {
7
7
  name: string,
8
8
  tags: [tag]
9
+ trained: boolean,
9
10
  }