import {MaterialIcons} from '@expo/vector-icons'; import React, {type ReactNode} from 'react'; import { StyleSheet, Text, View, TouchableOpacity, type StyleProp, type TextStyle, type ViewStyle, } from 'react-native'; type HeaderProps = { month: string; year: number; headerStyle?: StyleProp; headerFontStyle?: StyleProp; onNext: () => void; onPrev: () => void; iconNext?: ReactNode; iconPrev?: ReactNode; }; const _Header = ({ month, year, headerStyle, headerFontStyle, onNext, onPrev, iconNext, iconPrev, }: HeaderProps) => { return ( {iconPrev ? ( {iconPrev} ) : ( )} {month} {year} {iconNext ? ( {iconNext} ) : ( )} ); }; export const Header = React.memo(_Header); const styles = StyleSheet.create({ yearMonth: { paddingVertical: 10, backgroundColor: '#79afc1', justifyContent: 'space-between', alignItems: 'center', flexDirection: 'row', borderColor: '#dbeede', }, yearMonthText: { fontSize: 25, fontWeight: 'bold', fontStyle: 'normal', color: 'white', }, prevIcon: { transform: [{rotate: '180deg'}], }, });