2022-04-09 20:48:19 -04:00
|
|
|
import React from "react"
|
|
|
|
import styles from "./input.module.css"
|
2022-03-22 23:06:15 -04:00
|
|
|
|
|
|
|
type Props = React.HTMLProps<HTMLInputElement> & {
|
2022-04-09 20:48:19 -04:00
|
|
|
label?: string
|
|
|
|
fontSize?: number | string
|
2022-03-22 23:06:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// eslint-disable-next-line react/display-name
|
2022-04-09 20:48:19 -04:00
|
|
|
const Input = React.forwardRef<HTMLInputElement, Props>(
|
|
|
|
({ label, className, ...props }, ref) => {
|
|
|
|
return (
|
|
|
|
<div className={styles.wrapper}>
|
|
|
|
{label && <label className={styles.label}>{label}</label>}
|
|
|
|
<input
|
|
|
|
ref={ref}
|
|
|
|
className={className ? `${styles.input} ${className}` : styles.input}
|
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
)
|
2022-03-22 23:06:15 -04:00
|
|
|
|
|
|
|
export default Input
|