expo-popcore-old/components/bestai/section-header.tsx

36 lines
702 B
TypeScript

import { Pressable, StyleSheet, Text, View } from 'react-native';
type SectionHeaderProps = {
title: string;
onPress?: () => void;
};
export function SectionHeader({ title, onPress }: SectionHeaderProps) {
if (onPress) {
return (
<Pressable onPress={onPress} style={styles.container}>
<Text style={styles.title}>{title}</Text>
</Pressable>
);
}
return (
<View style={styles.container}>
<Text style={styles.title}>{title}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
marginTop: 28,
marginBottom: 18,
},
title: {
fontSize: 18,
fontWeight: '800',
letterSpacing: 1.2,
color: '#F5F8FF',
},
});