Generateurv2/frontend/components/pdf_gen/PdfForm.jsx

67 lines
1.8 KiB
React
Raw Normal View History

2022-05-18 10:15:54 +02:00
import { useState } from "react";
import styles from "../../styles/pdf_gen/pdfForm.module.scss";
2022-06-24 13:42:16 +02:00
import Input from "../Input.jsx";
2022-05-18 10:15:54 +02:00
export default function PdfForm({submit}) {
const [param, setParam] = useState({
name: "",
entete: "",
police: 14,
});
return (
<div className={styles.main}>
2022-06-24 13:42:16 +02:00
{/* <div className=""> */}
2022-05-18 10:15:54 +02:00
<h1>Fiche PDF</h1>
2022-06-24 13:42:16 +02:00
{/* <div className={styles.form}> */}
<Input
2022-05-18 10:15:54 +02:00
type="text"
placeholder="Nom du fichier"
value={param.name}
onChange={(e) => {
setParam({ ...param, name: e.target.value });
}}
/>
2022-06-24 13:42:16 +02:00
<Input
2022-05-18 10:15:54 +02:00
type="text"
placeholder="Entête de fiche"
value={param.entete}
onChange={(e) => {
setParam({ ...param, entete: e.target.value });
}}
/>
{/* <input
type="number"
className="exo-input"
min={10}
max={18}
step={2}
placeholder="Police (entre 10 et 18)"
value={param.police}
onChange={(e) => {
if (
parseInt(e.target.value) <=
18 /* && parseInt(e.target.value) >= 10 *||
e.target.value == ""
) {
setParam({ ...param, police: parseInt(e.target.value) });
} /* else if (parseInt(e.target.value) <= 10) {
setParam({ ...param, police: 10 });
}* else if (isNaN(parseInt(e.target.value))) {
setParam({ ...param });
}
}}
/> */}
2022-06-24 13:42:16 +02:00
{/* </div> */}
2022-05-18 10:15:54 +02:00
<button
className="exo-btn"
onClick={(e) => {
submit(param)
}}
>
Télécharger !
</button>
2022-06-24 13:42:16 +02:00
{/* </div> */}
2022-05-18 10:15:54 +02:00
</div>
);
}