add form errors

This commit is contained in:
Romulus21
2023-09-17 10:01:31 +02:00
parent 1e39c1b79f
commit 9b7a11dbd0
7 changed files with 87 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ import React, {
const Field: FC<FieldProps> = ({children, type = 'text', ...props}) => {
return <div className="form-group">
return <div className="form-control">
{children && <label className="block text-gray-900 dark:text-gray-200"
htmlFor={props.id ?? undefined}>
{children}
@@ -13,6 +13,7 @@ const Field: FC<FieldProps> = ({children, type = 'text', ...props}) => {
<input className="w-full mt-2 rounded dark:bg-gray-700"
type={type}
{...props}/>
<div className={`error-message`} />
</div>
}