import * as React from 'react'; import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native'; export type Props = React.ComponentPropsWithRef & { children: React.ReactNode; style?: StyleProp; }; const DialogActions = (props: Props) => { const actionsLength = React.Children.toArray(props.children).length; return ( {React.Children.map(props.children, (child, i) => React.isValidElement(child) ? React.cloneElement(child, { //@ts-ignore uppercase: true, style: { paddingRight: i + 1 === actionsLength ? 0 : 8, }, }) : child )} ); }; DialogActions.displayName = 'Dialog.Actions'; const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end', padding: 8, }, }); export default DialogActions;