structure refacto & file documentation
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 7s
This commit is contained in:
parent
d7871736c8
commit
895fec2b40
84 changed files with 2629 additions and 2313 deletions
16
website/src/components/ImportButton.jsx
Normal file
16
website/src/components/ImportButton.jsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Rôle : encapsule l'input fichier JSON derrière un bouton d'import réutilisable.
|
||||
import { Icon } from "./Icon.jsx";
|
||||
|
||||
export function ImportButton({ className, label, title, ariaLabel, icon, onFile }) {
|
||||
return (
|
||||
<label className={className} aria-label={ariaLabel} title={title}>
|
||||
{icon && <Icon name={icon} />}
|
||||
{label}
|
||||
<input type="file" accept="application/json" hidden onChange={async (event) => {
|
||||
const file = event.target.files?.[0];
|
||||
if (file) await onFile(file);
|
||||
event.target.value = "";
|
||||
}} />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue