mirror of
https://github.com/janishutz/fundamentals-of-webengineering.git
synced 2025-11-25 22:04:24 +00:00
Task 3: React Frontend
This commit is contained in:
23
task_3_react/src/client/components/CSVCard.tsx
Normal file
23
task_3_react/src/client/components/CSVCard.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from "react";
|
||||
import "../Layout.css";
|
||||
|
||||
const CSVCard = (props: {
|
||||
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void
|
||||
}) => {
|
||||
return (
|
||||
<article>
|
||||
<header>
|
||||
<h2>Select CSV data</h2>
|
||||
</header>
|
||||
<form>
|
||||
<label htmlFor="file-input" className="custom-file-upload">
|
||||
<i className="fa fa-file-csv"></i> Select CSV file to explore
|
||||
</label>
|
||||
<input id="file-input" type="file" aria-describedby="fileHelp" accept="text/csv" onChange={props.handleChange}/>
|
||||
<small>Please upload a CSV file, where the first row is the header.</small>
|
||||
</form>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
export default CSVCard;
|
||||
Reference in New Issue
Block a user