import { useTheme } from "common-ui"; import MaterialIcons from '@expo/vector-icons/MaterialIcons'; import React from 'react'; import { Platform, TouchableOpacity, ViewStyle } from 'react-native'; // import { useTheme } from '../hooks/theme-context'; interface CheckboxProps { checked: boolean; onPress?: () => void; style?: ViewStyle; size?: number; color?: string; disabled?: boolean; checkedColor?: string; // deprecated, use checkColor fillColor?: string; // new prop for box/circle fill checkColor?: string; // new prop for check/tick color testID?: string; } const Checkbox: React.FC = ({ checked, onPress, style, size = 24, disabled = false, checkedColor, // deprecated fillColor, checkColor, testID, }) => { const { colors } = useTheme().theme; const fill = fillColor || colors.brand500; const check = checkColor || colors.white1; // MaterialIcons glyphs: filled box/circle with the tick knocked out, same // visual as the MaterialCommunityIcons set this used to require (1.3 MB). const iconName = Platform.OS === 'android' ? checked ? 'check-box' : 'check-box-outline-blank' : checked ? 'check-circle' : 'radio-button-unchecked'; return ( {/* If checked, overlay a check icon with checkColor (for circle/box) */} {/* Not implemented here due to icon limitations, but checkColor is available for future use */} ); }; export default Checkbox;