import { Ionicons } from "@expo/vector-icons"; import { BlurView } from "expo-blur"; import type { PropsWithChildren } from "react"; import { Platform, type ViewProps } from "react-native"; import { Pressable } from "react-native-gesture-handler"; import { useHaptic } from "@/hooks/useHaptic"; interface Props extends ViewProps { onPress?: () => void; icon?: keyof typeof Ionicons.glyphMap; background?: boolean; size?: "default" | "large"; fillColor?: "primary"; color?: "white" | "purple"; hapticFeedback?: boolean; } export const RoundButton: React.FC> = ({ background = true, icon, onPress, children, size = "default", fillColor, color = "white", hapticFeedback = true, ...viewProps }) => { const buttonSize = size === "large" ? "h-10 w-10" : "h-9 w-9"; const fillColorClass = fillColor === "primary" ? "bg-purple-600" : ""; const lightHapticFeedback = useHaptic("light"); const handlePress = () => { if (hapticFeedback) { lightHapticFeedback(); } onPress?.(); }; if (Platform.OS === "ios") { return ( {icon ? ( ) : null} {children ? children : null} ); } if (fillColor) return ( {icon ? ( ) : null} {children ? children : null} ); if (background === false) return ( {icon ? ( ) : null} {children ? children : null} ); if (Platform.OS === "android") return ( {icon ? ( ) : null} {children ? children : null} ); return ( {icon ? ( ) : null} {children ? children : null} ); };