import React, {FC, ReactNode} from 'react'; import { StyleProp, StyleSheet, TouchableOpacity, View, ViewStyle, } from 'react-native'; import {SPACING_16} from '../Spacing/Spacing'; import PlayyText from '../PlayyText/PlayyText'; import {useHeaderContext} from './Header'; interface IconItem { name: string; size?: number; iconColor?: string; onPress?: () => void; } interface HeaderRightProps { children?: ReactNode; icons?: IconItem[]; isButton?: boolean; buttonTitle?: string; buttonTextColor?: string; buttonStyle?: StyleProp; onButtonPress?: () => void; } const HeaderRight: FC = ({ children, icons, isButton, buttonTitle, buttonTextColor, buttonStyle, onButtonPress, }) => { const {colors} = useHeaderContext(); const styles = themedStyle(); if (children) { return {children}; } return ( {icons && ( {icons.map((item: IconItem, index: number) => { return ( {item.name} ); })} )} {isButton && ( {buttonTitle} )} ); }; const themedStyle = () => StyleSheet.create({ rightSection: { flex: 1, justifyContent: 'flex-end', alignItems: 'flex-end', }, iconsList: { flexDirection: 'row', alignItems: 'center', gap: SPACING_16, }, }); export default HeaderRight;