Generateurv2/frontend/components/Input.jsx

15 lines
549 B
React
Raw Normal View History

2022-06-11 23:39:03 +02:00
import styles from '../styles/input.module.scss';
import { parseClassName } from '../utils/utils.js';
export default function Input(props) {
const id = Math.random()
return (
<span className={parseClassName([styles["input-container"], props.error ? styles['error']:undefined])}>
<input {...props} id={`input_${id}`} className={styles.input} required placeholder=''/>
<label className={styles.label} htmlFor={`input_${id}`}>
{props.placeholder}
</label>
<span className={styles.bar}></span>
</span>
);
}