import React from 'react' import { StyleSheet, View } from 'react-native' import TextButton from 'src/components/TextButton' import colors from 'src/styles/colors' export interface CallToAction { onPress: (params?: { index?: number }) => unknown text: string | React.ReactNode dim?: boolean isSecondary?: boolean } interface Props { callToActions: CallToAction[] testID?: string positionInNotificationList?: number } export default function CallToActionsBar({ callToActions, testID, positionInNotificationList, }: Props) { return ( {callToActions.map((cta, i) => { if (typeof cta.text === 'string') { return ( cta.onPress({ index: positionInNotificationList })} > {cta.text} ) } return ( {cta.text} ) })} ) } const styles = StyleSheet.create({ container: { flexDirection: 'row', justifyContent: 'flex-start', flexWrap: 'wrap', }, action: { fontSize: 14, lineHeight: 16, marginRight: 24, minWidth: 48, minHeight: 16, }, secondaryAction: { color: colors.textLink, }, })