This commit is contained in:
Marta Kowalska
2026-01-28 14:26:58 +00:00
parent a34aa9ad0a
commit 87a05884a8
24 changed files with 627 additions and 445 deletions
+35
View File
@@ -0,0 +1,35 @@
import React, { useRef } from 'react';
import './UbloadButton.css';
function UploadButton({ text, onChange }) {
const fileInput = useRef(null);
function handleClick() {
fileInput.current?.click();
}
function handleChange() {
if (onChange) {
onChange();
}
}
return (
<>
<button className="button" onClick={handleClick}>
{text}
</button>
<input
ref={fileInput}
id="import-file"
type="file"
accept=".xml"
onChange={handleChange}
style={{ display: 'none' }}
/>
</>
);
}
export default UploadButton;