HEX
Server: Apache
System: Linux webd003.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: slyfwmm (169339)
PHP: 8.1.34
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/slyfwmm/pianob/wp-content/plugins/hbook/blocks/rates-block.js
registerBlockType( 'hbook/rates', {
	title: hb_blocks_text.rates_title,
	icon: 'grid-view',
	category: 'hbook-blocks',
	supports: {
		className: false,
		customClassName: false,
		html: false
	},

	edit: function edit( props ) {
		var setAttributes = props.setAttributes;
		var attributes = props.attributes;
		var accom_id = props.attributes.accom_id;
		var type = props.attributes.type;
		var sorting = props.attributes.sorting;

		function on_accom_change( changes ) {
			setAttributes({ accom_id: changes });
		}

		function on_type_change( changes ) {
			setAttributes({ type: changes });
		}

		function on_sorting_change( changes ) {
			setAttributes({ sorting: changes });
		}

		return [
			el(
				InspectorControls,
				null,
				el(
					PanelBody,
					{ title: hb_blocks_text.rates_settings },
					el(
						SelectControl, {
							label: hb_blocks_text.accom,
							value: accom_id,
							onChange: on_accom_change,
							options: hb_blocks_data.accom_options_without_all
						}
					),
					el(
						SelectControl, {
							label: hb_blocks_text.rates_type,
							value: type,
							onChange: on_type_change,
							options: [{ value: 'accom', label: hb_blocks_text.rates_type_accom }, { value: 'extra_adults', label: hb_blocks_text.rates_type_adults }, { value: 'extra_children', label: hb_blocks_text.rates_type_children }]
						}
					),
					el(
						SelectControl, {
							label: hb_blocks_text.rates_sorting,
							value: sorting,
							onChange: on_sorting_change,
							options: [{ value: 'grouped', label: hb_blocks_text.rates_sorting_grouped }, { value: 'chrono', label: hb_blocks_text.rates_sorting_chrono }]
						}
					)
				)
			),
			el(
				'div',
				{ style: { background: '#fff', border: '1px solid', padding: '10px 15px' } },
				el(
					'div',
					null,
					hb_blocks_text.rates_block
				),
				! accom_id &&
				el(
					'div',
					{ style: { color: '#d94f4f', fontSize: '13px' } },
					hb_blocks_text.select_accom
				)
			)
		];
	},
	save: function save() {
		return null;
	}
});