import * as React from 'react'; import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native'; type Props = React.ComponentPropsWithRef & { /** * Items inside the `CardActions`. */ children: React.ReactNode; style?: StyleProp; }; /** * A component to show a list of actions inside a Card. * *
*
* *
*
* * ## Usage * ```js * import * as React from 'react'; * import { Card, Button } from 'react-native-paper'; * * const MyComponent = () => ( * * * * * * * ); * * export default MyComponent; * ``` */ const CardActions = (props: Props) => ( {React.Children.map(props.children, (child) => React.isValidElement(child) ? React.cloneElement(child, { compact: child.props.compact !== false, }) : child )} ); CardActions.displayName = 'Card.Actions'; const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', padding: 8, }, }); export default CardActions;