This commit is contained in:
Harikrishnan Gopal
2025-01-22 01:58:09 +05:30
parent 7079591f84
commit 1fc49ca69a
6 changed files with 109 additions and 62 deletions

View File

@@ -0,0 +1,26 @@
import React from "react";
import axios from "axios";
const GenerateCSV = () => {
const handleGenerateCSV = async () => {
try {
const response = await axios.get("http://localhost:8080/api/csv/generate");
if (response.status === 200) {
alert("CSV generated successfully. Check the generated_csv folder in the server.");
}
} catch (error) {
console.error("Error generating CSV:", error);
alert("Failed to generate CSV");
}
};
return (
<div>
<button onClick={handleGenerateCSV} style={{ padding: "10px 20px", fontSize: "16px" }}>
Generate CSV
</button>
</div>
);
};
export default GenerateCSV;