-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: train page added && menu added
- Loading branch information
Showing
9 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import { HashRouter } from "react-router-dom"; | ||
import "./App.css"; | ||
import Router from "./routes"; | ||
|
||
function App() { | ||
return <Router />; | ||
return ( | ||
<HashRouter> | ||
{/* HashRouter é rota com # ex: google.com#/rota-aqui*/} | ||
<Router /> | ||
</HashRouter> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState } from "react"; | ||
import { HiOutlineMenu, HiOutlineX } from "react-icons/hi"; // Importando ícones do React Icons | ||
import { Link } from "react-router-dom"; | ||
|
||
export function Menu() { | ||
const [isExpanded, setIsExpanded] = useState(false); | ||
|
||
const toggleMenu = () => { | ||
setIsExpanded(!isExpanded); | ||
}; | ||
|
||
return ( | ||
<nav | ||
className={`text-white fixed top-0 left-0 bottom-0 z-50 overflow-y-auto ${ | ||
isExpanded ? "bg-gray-800 overflow-y-auto w-64" : "overflow-hidden" | ||
}`} | ||
> | ||
<div className="flex justify-between items-center p-4"> | ||
<div className={`text-2xl font-bold ${isExpanded ? "" : "sr-only"}`}> | ||
Menu | ||
</div> | ||
<button | ||
className="text-white focus:outline-none focus:text-white" | ||
onClick={toggleMenu} | ||
> | ||
{isExpanded ? ( | ||
<HiOutlineX className="h-6 w-6" /> | ||
) : ( | ||
<HiOutlineMenu className="h-6 w-6" /> | ||
)} | ||
</button> | ||
</div> | ||
<ul className={`p-4 ${isExpanded ? "" : "hidden"}`}> | ||
<li className={`my-2`}> | ||
{" "} | ||
<Link to="/">Classificar</Link> | ||
</li> | ||
<li className={`my-2`}> | ||
<Link to="/train">Treinar</Link> | ||
</li> | ||
</ul> | ||
</nav> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { useState } from "react"; | ||
import SelectFileCard from "../components/selectFileCard/selectFileCard"; | ||
import axios from "axios"; | ||
import ResultTable from "../components/resultTable/resultTable"; | ||
import { Menu } from "../components/menu/menu"; | ||
|
||
export default function Train() { | ||
const [selectedFile, setSelectedFile] = useState<File | null>(null); | ||
|
||
const [data, setData] = useState<any[][]>([]); | ||
const [header, setHeader] = useState<string[]>([]); | ||
|
||
const [selectedColumn, setSelectedColumn] = useState<number>(0); | ||
const [selectedLabel, setSelectedLabel] = useState<string>(""); | ||
|
||
const [result, setResult] = useState<{ [key: string]: any }>({}); | ||
|
||
const [isLoading, setIsLoading] = useState(false); | ||
|
||
const handleChangeSelectedColumn = (event: any) => { | ||
setSelectedColumn(event.target.value); | ||
}; | ||
|
||
const handleChangeSelectedLabel = (event: any) => { | ||
setSelectedLabel(event.target.value); | ||
}; | ||
|
||
const handleSubmit = async () => {}; | ||
|
||
return ( | ||
<div className="bg-main-darker text-white min-h-screen flex flex-col"> | ||
<Menu /> | ||
|
||
<div className="p-8 text-center font-roboto"> | ||
<h1 className="text-3xl font-bold mb-6 mt-6"> | ||
Linguif<span className="text-main-light">AI</span> | ||
</h1> | ||
|
||
{ | ||
<SelectFileCard | ||
selectedFile={selectedFile} | ||
setSelectedFile={setSelectedFile} | ||
setData={setData} | ||
data={data} | ||
setHeader={setHeader} | ||
header={header} | ||
/> | ||
} | ||
|
||
<div className="w-1/3 relative mx-auto mt-24"> | ||
<select | ||
className="w-full bg-main-dark border-2 border-main-lighter rounded-3xl py-2 px-4 hover:bg-main-darker text-white focus:outline-none h-14" | ||
onChange={handleChangeSelectedColumn} | ||
> | ||
<option value="" disabled selected className="placeholder-gray-300"> | ||
Selecione a coluna de entrada | ||
</option> | ||
{header.length > 0 && | ||
header.map((column: string, index: number) => { | ||
return <option value={index}>{column}</option>; | ||
})} | ||
</select> | ||
</div> | ||
|
||
<div className="w-1/3 relative mx-auto mt-10"> | ||
<select | ||
className="w-full bg-main-dark border-2 border-main-lighter rounded-3xl py-2 px-4 hover:bg-main-darker text-white focus:outline-none h-14" | ||
onChange={handleChangeSelectedColumn} | ||
> | ||
<option value="" disabled selected className="placeholder-gray-300"> | ||
Selecione a coluna de label | ||
</option> | ||
{header.length > 0 && | ||
header.map((column: string, index: number) => { | ||
return <option value={index}>{column}</option>; | ||
})} | ||
</select> | ||
</div> | ||
|
||
<div className="w-1/4 relative mx-auto mt-10"> | ||
<button | ||
className="w-full bg-main-dark text-white py-2 px-4 hover:bg-main-darker focus:outline-none border-2 border-main-lighter rounded-3xl h-14" | ||
onClick={handleSubmit} | ||
> | ||
{isLoading ? "Carregando..." : "Treinar"} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters