39 lines
716 B
TypeScript
39 lines
716 B
TypeScript
// BirthdayItem.tsx
|
|
import { StyleSheet, Text, View } from "react-native";
|
|
|
|
interface BirthdayItemProps {
|
|
name: string;
|
|
date: string;
|
|
age?: number;
|
|
}
|
|
|
|
export function BirthdayItem({ name, date, age }: BirthdayItemProps) {
|
|
return (
|
|
<View style={styles.itemContainer}>
|
|
<Text style={styles.name}>{name}</Text>
|
|
{age && <Text style={styles.age}>Age: {age}</Text>}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
itemContainer: {
|
|
padding: 15,
|
|
borderRadius: 8,
|
|
backgroundColor: "#f0f0f0",
|
|
elevation: 2,
|
|
marginBottom: 10,
|
|
},
|
|
name: {
|
|
fontSize: 16,
|
|
fontWeight: "bold",
|
|
},
|
|
date: {
|
|
fontSize: 14,
|
|
},
|
|
age: {
|
|
fontSize: 12,
|
|
marginTop: 5,
|
|
},
|
|
});
|