diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx index c2f045a..bd4dd42 100644 --- a/src/components/header/Header.jsx +++ b/src/components/header/Header.jsx @@ -1,15 +1,47 @@ import Dropdown from "../shared/dropdown/Dropdown.jsx"; import DropdownItem from "../shared/dropdown/DropdownItem.jsx"; +import {useState} from "react"; const Header = () => { + const [fileContent, setFileContent] = useState(""); + + const handleFileChange = (event) => { + const file = event.target.files[0]; + if (file) { + if (file.type === "text/plain") { + const reader = new FileReader(); + reader.onload = (e) => { + console.log("File content:", e.target.result); + setFileContent(e.target.result); + }; + reader.readAsText(file); + } else { + + } + } + }; + + const openFilePicker = () => { + document.getElementById("fileInput").click(); + }; + return (<> -
+
- - + { + openFilePicker() + }}/>
+ ) }