scaffold create/edit beer form, scaffold beer page

This commit is contained in:
Aaron William Po
2023-01-23 20:13:25 -05:00
parent f08731de17
commit 972846f5a8
29 changed files with 776 additions and 70 deletions

View File

@@ -0,0 +1,33 @@
/* eslint-disable react/require-default-props */
import { FunctionComponent } from 'react';
import { FieldError, UseFormRegisterReturn } from 'react-hook-form';
interface FormInputProps {
placeholder?: string;
formValidationSchema: UseFormRegisterReturn<string>;
error: boolean;
// eslint-disable-next-line react/require-default-props
type: 'email' | 'password' | 'text' | 'date';
id: string;
height?: string;
}
const FormTextInput: FunctionComponent<FormInputProps> = ({
placeholder = '',
formValidationSchema,
error,
type,
id,
}) => (
<input
id={id}
type={type}
placeholder={placeholder}
className={`input w-full transition ease-in-out rounded-lg input-bordered ${
error ? 'input-error' : ''
}`}
{...formValidationSchema}
/>
);
export default FormTextInput;