version nice

This commit is contained in:
nBiqoz
2025-07-26 21:39:49 +02:00
parent aa19bb82a0
commit 5ba4fdc450
16 changed files with 1462 additions and 517 deletions

View File

@@ -0,0 +1,23 @@
interface DownloadActionsProps {
outputText: string;
}
export const useDownloadActions = ({ outputText }: DownloadActionsProps) => {
const copyToClipboard = () => {
navigator.clipboard.writeText(outputText);
};
const downloadText = () => {
const blob = new Blob([outputText], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "texte-anonymise.txt";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
};
return { copyToClipboard, downloadText };
};