From 2ffa4d87da7a40d00ca2163feb2f4c55f9970832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thau=C3=A3=20Magalh=C3=A3es?= Date: Mon, 17 Jun 2024 14:55:16 -0300 Subject: [PATCH] feat: minor adjusts added --- src/components/breadcumbs/breadcumbs.tsx | 36 +++++++++++++++++ .../selectFileCard/selectFileCard.tsx | 1 + src/pages/about.tsx | 8 +++- src/pages/home.tsx | 6 ++- src/pages/train.tsx | 6 ++- src/pages/views/trainView.tsx | 39 +++++++++++++------ 6 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 src/components/breadcumbs/breadcumbs.tsx diff --git a/src/components/breadcumbs/breadcumbs.tsx b/src/components/breadcumbs/breadcumbs.tsx new file mode 100644 index 00000000..310fae92 --- /dev/null +++ b/src/components/breadcumbs/breadcumbs.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +interface Crumb { + label: string; + path?: string; +} + +interface BreadcrumbProps { + crumbs: Crumb[]; +} + +const Breadcrumb: React.FC = ({ crumbs }) => { + const baseCrumb = { label: 'LinguifAI', path: '/' }; + const allCrumbs = [baseCrumb, ...crumbs]; + + return ( +
+ +
+ ); +}; + +export default Breadcrumb; diff --git a/src/components/selectFileCard/selectFileCard.tsx b/src/components/selectFileCard/selectFileCard.tsx index 30d01fe1..e02b3e6e 100644 --- a/src/components/selectFileCard/selectFileCard.tsx +++ b/src/components/selectFileCard/selectFileCard.tsx @@ -110,6 +110,7 @@ export default function SelectFileCard({ onChange={handleFileChange} /> +

Por favor, selecione um arquivo no formato .csv

) : (
; + return ( + + + + + ) } diff --git a/src/pages/home.tsx b/src/pages/home.tsx index edcda349..47a28c49 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -1,7 +1,11 @@ +import Breadcrumb from "../components/breadcumbs/breadcumbs"; import Layout from "./layout/layout"; import HomeView from "./views/homeView"; export default function Home() { - return ; + return + + + ; } diff --git a/src/pages/train.tsx b/src/pages/train.tsx index c20d55bf..9accde12 100644 --- a/src/pages/train.tsx +++ b/src/pages/train.tsx @@ -6,10 +6,14 @@ import { Menu } from "../components/menu/menu"; import { ReactApexChartsDefaultOptions } from "../Shared/apexChartsOptions"; import Layout from "./layout/layout"; import TrainView from "./views/trainView"; +import Breadcrumb from "../components/breadcumbs/breadcumbs"; export default function Train() { return ( - + + + + ); } diff --git a/src/pages/views/trainView.tsx b/src/pages/views/trainView.tsx index 19be82ae..062f2965 100644 --- a/src/pages/views/trainView.tsx +++ b/src/pages/views/trainView.tsx @@ -168,7 +168,7 @@ export default function TrainView() { const newProgress: number = training_in_progress || training_progress === 100 ? training_progress - : 0; + : 0; updateLoadingProgress(newProgress); setTrainLosses(train_losses); @@ -205,6 +205,12 @@ export default function TrainView() { return () => clearInterval(interval); }, []); + const [trainingType, setTrainingType] = useState("nb"); + + const handleTrainingTypeChange = (event: React.ChangeEvent) => { + setTrainingType(event.target.value); + } + return (
+ +
+ + +
+ +
{isLoading && ( @@ -330,19 +353,11 @@ export default function TrainView() { )} {!isLoading && } - - {!isLoading && } {hasTrained && train_losses.length > 0 && (