// #region [Imports] =================================================================================================== // Libraries import { ToggleControl } from '@wordpress/components'; // Types import { IContentVisibility, IAttributes } from '../../types/settings'; // #endregion [Imports] // #region [Variables] ================================================================================================= declare var acfwfBlocksi18n: any; const { contentDisplaySettings } = acfwfBlocksi18n; // #endregion [Variables] // #region [Interfaces] ================================================================================================ interface IProps { onChange: (IAttributes) => void; settings: IContentVisibility; } // #endregion [Interfaces] // #region [Component] ================================================================================================= const ContentSettingsControl = (props: IProps) => { const { onChange, settings } = props; const { discount_value, description, usage_limit, schedule, expired_coupons } = settings; return ( <> onChange({ ...settings, discount_value: !discount_value })} /> onChange({ ...settings, description: !description })} /> onChange({ ...settings, usage_limit: !usage_limit })} /> onChange({ ...settings, schedule: !schedule })} /> onChange({ ...settings, expired_coupons: !expired_coupons })} /> ); }; export default ContentSettingsControl; // #endregion [Component]