mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
26 lines
713 B
JavaScript
26 lines
713 B
JavaScript
import { Button } from '@wordpress/components';
|
|
import SettingsBlock from './SettingsBlock';
|
|
import { Header, Title, Action, Description } from './SettingsBlockElements';
|
|
|
|
const ButtonSettingsBlock = ( { title, description, ...props } ) => (
|
|
<SettingsBlock { ...props } className="ppcp-r-settings-block__button">
|
|
<Header>
|
|
<Title>{ title }</Title>
|
|
<Description>{ description }</Description>
|
|
</Header>
|
|
<Action>
|
|
<Button
|
|
variant={ props.actionProps?.buttonType }
|
|
onClick={
|
|
props.actionProps?.callback
|
|
? () => props.actionProps.callback()
|
|
: undefined
|
|
}
|
|
>
|
|
{ props.actionProps.value }
|
|
</Button>
|
|
</Action>
|
|
</SettingsBlock>
|
|
);
|
|
|
|
export default ButtonSettingsBlock;
|