import React from "react";
import tw, { styled } from "twin.macro";
;
//import { useField as useFormikField, useFormikContext } from "formik";
const useFormikField = null;
const useFormikContext = ()=>{};
export function useField(props){
let getField = useFormikField;
const context = useFormikContext();
if(!context){
getField = (props)=>{
return [props, null, null];
}
}
return getField(props);
}
export default function Input({ label, title, children, ...props }) {
/*name, id*/
const [field, meta, helpers] = useField(props);
return (
{title && (
)}
{/*name={name || title} id={id || name || title}*/}
{children}
{meta?.touched && meta.error ? (
{meta.error}
) : null}
);
}
export function TextArea({
label,
title,
children,
...props
}) {
const [field, meta, helpers] = useField(props);
return (
{title && (
)}
{children}
{meta?.touched && meta.error ? (
{meta.error}
) : null}
);
}
export function CheckBox({
label,
title,
children,
...props
}) {
const [field, meta, helpers] = useField(props);
return (
{title != null ? (
) : null}
{children}
);
}