import React from 'react'; import { View, Text, StyleSheet, Share } from 'react-native'; import { useThemedStyles, Theme } from '../theme'; import Icon from './Icon'; interface Props { children: string; shareContent?: string; } const Header: React.FC = ({ children, shareContent }) => { const styles = useThemedStyles(themedStyles); return ( {children} {!!shareContent && ( { Share.share({ message: shareContent }); }} iconStyle={styles.shareIcon} /> )} ); }; const themedStyles = (theme: Theme) => StyleSheet.create({ header: { fontWeight: 'bold', fontSize: 20, marginTop: 10, marginBottom: 5, marginHorizontal: 10, color: theme.colors.text, }, shareIcon: { width: 24, height: 24, }, container: { justifyContent: 'space-between', flexDirection: 'row', alignItems: 'center', }, }); export default Header;