Skip to content
Snippets Groups Projects
Commit 5f2bee66 authored by Štěpán Šonovský's avatar Štěpán Šonovský
Browse files

feat: Added csv file link

parent b0bc80d0
No related branches found
No related tags found
No related merge requests found
import {CSVLink} from "react-csv";
import {useCommitsPositivity} from "@/app/hooks/useCommitDetails";
import {useCommitTestFiles} from "@/app/hooks/useCommitTestFiles";
const CsvDownloadTestFiles = ({commits, projectId, token}) => {
const {data, isLoading} = useCommitTestFiles(projectId, commits, token);
console.log(data);
return (
<div>
{!isLoading && data ? (
<CSVLink
data={data}
target="_blank"
enclosingCharacter={``}
className="mt-4 bg-blue-500 text-white font-bold py-2 px-4 rounded hover:bg-blue-700"
>
Download CSV commits test files
</CSVLink>
) : (
<p>Loading...</p>
)}
</div>
);
};
export default CsvDownloadTestFiles;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment