//import Papa from 'papaparse';
import { st_award_csv } from "../services/Apis";
//import Table, { StatusPill } from "./Table";
import React, { useState } from 'react'
import csv from 'fast-csv';
export default function Profile3() {
const handleSubmit = async (event) => {
try {
const file = event.target.files[0];
const stream = file.stream();
const results = [];
csv.parseStream(stream, { headers: true })
.on('data', (data) => results.push(data))
.on('end', async () => {
await st_award_csv(results);
console.log('done');
});
} catch (error) {
console.error(error);
}
};
return (
<div className="App">
<input
type="file"
accept=".csv,.xlsx,.xls"
onChange={handleSubmit}
/>
</div>
);
}