BaaS_Driver_Android_App/components/Payments/EmiNotification.tsx

99 lines
2.1 KiB
TypeScript

import React from "react";
import { View, Text, StyleSheet, TouchableOpacity } from "react-native";
import CheckIcon from "@/assets/icons/check_circle.svg";
interface EMINotificationProps {
message: string;
actionText?: string;
onActionPress?: () => void;
}
const EMINotification: React.FC<EMINotificationProps> = ({
message,
actionText,
onActionPress,
}) => {
return (
<View style={styles.container}>
<View style={styles.content}>
<View style={styles.checkIconContainer}>
<CheckIcon width={20} height={20} />
</View>
<View style={styles.textContainer}>
<Text style={styles.messageText}>{message}</Text>
</View>
{actionText && onActionPress && (
<TouchableOpacity style={styles.actionButton} onPress={onActionPress}>
<Text style={styles.actionText}>{actionText}</Text>
</TouchableOpacity>
)}
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
height: 72,
backgroundColor: "#FCFCFC",
borderRadius: 10,
padding: 16,
justifyContent: "center",
alignItems: "center",
},
content: {
flexDirection: "row",
alignItems: "center",
height: 40,
gap: 12,
},
checkIconContainer: {
width: 40,
height: 40,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#EBFAF6",
borderRadius: "50%",
},
checkIcon: {
width: 24,
height: 24,
backgroundColor: "#10B981",
borderRadius: 12,
justifyContent: "center",
alignItems: "center",
},
checkMark: {
color: "white",
fontSize: 16,
fontWeight: "bold",
},
textContainer: {
flex: 1,
height: 40,
justifyContent: "center",
paddingRight: 8,
},
messageText: {
fontSize: 12,
fontWeight: "500",
color: "#565F70",
fontFamily: "Inter-Medium",
lineHeight: 16,
},
actionButton: {
paddingVertical: 8,
borderRadius: 4,
},
actionText: {
fontSize: 14,
fontWeight: "500",
color: "#006C4D",
fontFamily: "Inter-Medium",
lineHeight: 20,
textAlign: "center",
},
});
export default EMINotification;