import React, { ReactElement } from "react";
import { Pressable, Text, StyleSheet, ViewStyle, StyleProp } from "react-native";

interface NormalButtonProps {
	title: ReactElement;
	extendedStyle?: StyleProp<ViewStyle>;
	onPress: () => void;
	disabled?: boolean;
}

const NormalButton: React.FC<NormalButtonProps> = ({ title, extendedStyle, onPress, disabled }) => {
	return (
		<Pressable
			onPress={onPress}
			disabled={disabled}
			style={({ pressed }) => [styles.button, pressed ? styles.buttonPressed : null, extendedStyle]}
		>
			{title}
		</Pressable>
	);
};

const styles = StyleSheet.create({
	button: {
		maxWidth: "100%",
		fontSize: 16,
		backgroundColor: "#025c72",
		justifyContent: "center",
		alignItems: "center",
		borderRadius: 12,
		padding: 20,
	},
	buttonPressed: {
		backgroundColor: "#28495c",
	},
});

export default NormalButton;
