UNPKG

@wordpress/components

Version:
44 lines (39 loc) 1.11 kB
import { createElement } from "@wordpress/element"; /** * External dependencies */ import { View } from 'react-native'; /** * WordPress dependencies */ import { TextControl } from '@wordpress/components'; import { withPreferredColorScheme } from '@wordpress/compose'; import { useMemo } from '@wordpress/element'; /** * Internal dependencies */ import styles from './actions.scss'; import BottomSeparatorCover from './bottom-separator-cover'; function PanelActions({ actions, getStylesFromColorScheme }) { const mappedActions = useMemo(() => { return actions.map(({ label, onPress }) => { return createElement(TextControl, { label: label, onPress: onPress, labelStyle: styles.defaultLabelStyle, key: label }); }); }, [actions]); return createElement(View, { style: getStylesFromColorScheme(styles.panelActionsContainer, styles.panelActionsContainerDark) }, mappedActions, createElement(BottomSeparatorCover, null)); } export default withPreferredColorScheme(PanelActions); //# sourceMappingURL=actions.native.js.map