import Styles from "@/constants/Styles";
import { Dimensions, Platform, TextInput, View } from "react-native";
import Text from "./Text";
type Props = {
label?: string;
placeholder?: string;
onChange?: (val: string) => void;
info?: string;
itemLeft?: React.ReactNode;
itemRight?: React.ReactNode;
error?: boolean;
errorText?: string;
required?: boolean;
type: 'default' | 'visible-password' | 'numeric'
round?: boolean
width?: number
bg?: 'white' | 'transparent'
value?: string
disable?: boolean
multiline?: boolean
mb?: boolean
};
export function InputForm({ label, value, placeholder, onChange, info, disable, error, errorText, required, itemLeft, itemRight, type, round, width, bg, multiline, mb = true }: Props) {
const lebar = Dimensions.get("window").width;
if (itemLeft != undefined || itemRight != undefined) {
return (
{
label != undefined && (
{label}
{required && (*)}
)
}
{itemRight != undefined ? itemRight : itemLeft}
{error && ({errorText})}
{info != undefined && ({info})}
)
}
return (
{
label != undefined && (
{label}
{required && (*)}
)
}
{error && ({errorText})}
{info != undefined && ({info})}
)
}