import React, { forwardRef } from "react"; import { View, TouchableOpacity, ViewProps } from "react-native"; import Text from "./ui/Text"; import { AntDesign, Entypo, FontAwesome6, Ionicons, MaterialCommunityIcons, } from "@expo/vector-icons"; import { AntDesignIconNames, CommunityIconNames, EntypoIconNames, FontAwesome6IconNames, FontAwesomeIconNames, IonIconNames, } from "./Icons"; export type CheckBoxDirection = "row" | "col"; interface CheckBoxProps extends ViewProps { label?: string; onChange: () => void; antIcon?: AntDesignIconNames; entypoIcon?: EntypoIconNames; fontAwesomeIcon?: FontAwesomeIconNames; fontAwesome6Icon?: FontAwesome6IconNames; communityIcon?: CommunityIconNames; IonIcon?: IonIconNames; value: boolean; isCheckIconVisible?: boolean; endText?: string; direction?: CheckBoxDirection; } export default forwardRef( ( { label, onChange, antIcon, entypoIcon, fontAwesomeIcon, fontAwesome6Icon, communityIcon, IonIcon, value, isCheckIconVisible, endText, direction, className, ...props }, ref ) => { return ( {antIcon ? ( ) : null} {entypoIcon ? ( ) : null} {communityIcon ? ( ) : null} {fontAwesomeIcon ? ( ) : null} {fontAwesome6Icon ? ( ) : null} {IonIcon ? ( ) : null} {label != null ? ( {label} ) : null} {isCheckIconVisible ? ( {value && } ) : null} {endText != null ? ( {endText} ) : null} ); } );