import React from "react"; import { TouchableOpacity, Text, StyleSheet, ActivityIndicator, ViewStyle } from "react-native"; import colors from "./colors"; type CustomButtonProps = { title: string; onPress: () => void; backgroundColor?: string; textColor?: string; loading?: boolean; style?: ViewStyle; }; export default function CustomButton({ title, onPress, backgroundColor = colors.pastelGreen, textColor = colors.textDark, loading = false, style, }: CustomButtonProps) { return ( {loading ? ( ) : ( {title} )} ); } const styles = StyleSheet.create({ button: { elevation:5, paddingVertical: 16, paddingHorizontal: 20, borderRadius: 12, alignItems: "center", justifyContent: "center", marginVertical: 5, }, text: { fontSize: 16, fontWeight: "bold", }, });