mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-14 08:15:27 +00:00
4ad0914b17
Implement generic Wizard component for future use in Gameyfin
33 lines
960 B
TypeScript
33 lines
960 B
TypeScript
import {useField} from "formik";
|
|
import {Input as MaterialInput, Typography} from "@material-tailwind/react";
|
|
import {XCircle} from "@phosphor-icons/react";
|
|
|
|
// @ts-ignore
|
|
const Input = ({label, ...props}) => {
|
|
// @ts-ignore
|
|
const [field, meta] = useField(props);
|
|
|
|
return (
|
|
<>
|
|
<MaterialInput
|
|
{...props}
|
|
{...field}
|
|
label={label}
|
|
error={meta.touched && !!meta.error}
|
|
success={meta.touched && !meta.error}
|
|
crossOrigin=""
|
|
/>
|
|
{(meta.touched && !!meta.error) ?
|
|
<Typography
|
|
variant="small"
|
|
color="red"
|
|
className="ml-3 -mt-5 flex flex-row items-center gap-1"
|
|
>
|
|
<XCircle weight="fill" size={14}/> {meta.error}
|
|
</Typography> : <></>
|
|
}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default Input; |