import React from 'react'; import Dialog from '../Dialog'; import Button from '../Buttons/Button'; import Text, {TextProps} from '../Core/Typography'; type ActionType = { color?: string; label?: string; accessibilityLabel?: string; onPress?: (event?: any) => void; }; type AlertType = { onDismiss?: () => void | undefined; header?: { title?: string; subtitle?: string; titleProps?: TextProps; subtitleProps?: TextProps; }; prompt?: boolean; contentText?: string; action?: ActionType[]; isOpen?: boolean; }; const Alert: React.FC = ({ onDismiss, header, prompt = false, contentText = '', action, isOpen = false, }) => { return ( {header && } {(contentText || prompt) && ( {contentText} )} {action && action.map(({label, accessibilityLabel, color, onPress}, k) => ( ))} ); }; export default Alert;