import { Button } from '@wordpress/components'; import { Header, Title, Action, Description } from '../Elements'; import SettingsBlock from '../SettingsBlock'; import TitleBadge from '../TitleBadge'; const FeatureSettingsBlock = ( { title, description, ...props } ) => { const printNotes = () => { const notes = props.actionProps?.notes; if ( ! notes || ( Array.isArray( notes ) && notes.length === 0 ) ) { return null; } return ( { notes.map( ( note, index ) => ( { note } ) ) } ); }; const FeatureButton = ( { className, variant, text, isBusy, url, urls, onClick, } ) => { const buttonProps = { className, isBusy, variant, }; if ( url || urls ) { buttonProps.href = urls ? urls.live : url; buttonProps.target = '_blank'; } if ( ! buttonProps.href ) { buttonProps.onClick = onClick; } return { text }; }; return ( { title } { props.actionProps?.enabled && ( ) } { description } { printNotes() } { props.actionProps?.buttons.map( ( { class: className, type, text, url, urls, onClick, } ) => ( ) ) } ); }; export default FeatureSettingsBlock;