1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import { StyleSheet, Text } from 'react-native';
type StatusMessageProps = {
message: string;
tone?: 'error' | 'success';
};
export function StatusMessage({
message,
tone = 'error',
}: StatusMessageProps) {
return (
<Text style={[styles.base, tone === 'error' ? styles.error : styles.success]}>
{message}
</Text>
);
}
const styles = StyleSheet.create({
base: {
borderRadius: 10,
paddingHorizontal: 12,
paddingVertical: 10,
},
error: {
backgroundColor: '#fde7e9',
color: '#9f1d35',
},
success: {
backgroundColor: '#e1f5e8',
color: '#166534',
},
});
|