add linter
This commit is contained in:
@@ -10,7 +10,7 @@ const Field: FC<FieldProps> = ({children, type = 'text', className = '', classNa
|
||||
htmlFor={props.id ?? undefined}>
|
||||
{children}
|
||||
</label>}
|
||||
<input className={`${className} w-full mt-2 rounded dark:bg-gray-700`}
|
||||
<input className={`${className} mt-2 w-full rounded dark:bg-gray-700`}
|
||||
type={type}
|
||||
{...props}/>
|
||||
<div className={`error-message`} />
|
||||
@@ -24,7 +24,7 @@ interface FieldProps {
|
||||
type?: HTMLInputTypeAttribute,
|
||||
name: string,
|
||||
id?: string,
|
||||
value: any,
|
||||
value: string|number|undefined,
|
||||
placeholder?: string,
|
||||
autoFocus?: boolean,
|
||||
className?: string,
|
||||
@@ -32,3 +32,27 @@ interface FieldProps {
|
||||
step?: string,
|
||||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void,
|
||||
}
|
||||
|
||||
export const TextArea: FC<TextAreaProps> = ({children, name, value, className = '', classNameForm = '', ...props}) => {
|
||||
|
||||
return <div className={`form-control ${classNameForm}`}>
|
||||
{children && <label className="block text-gray-900 dark:text-gray-200"
|
||||
htmlFor={props.id ?? undefined}>
|
||||
{children}
|
||||
</label>}
|
||||
<textarea name={name} className={`${className} mt-2 w-full rounded dark:bg-gray-700`} {...props}>
|
||||
{value}
|
||||
</textarea>
|
||||
<div className={`error-message`}/>
|
||||
</div>
|
||||
}
|
||||
|
||||
interface TextAreaProps {
|
||||
children?: ReactElement|string,
|
||||
id?: string,
|
||||
name: string,
|
||||
value: string|undefined,
|
||||
className?: string,
|
||||
classNameForm?: string,
|
||||
onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user