/* eslint-disable @wordpress/i18n-ellipsis */ import { loadEventList } from '../../events-loader.js' const { InspectorControls, useBlockProps } = wp.blockEditor const { useEffect } = wp.element const { PanelBody } = wp.components const { __ } = wp.i18n const NAME = '' export default ({ attributes, setAttributes }) => { const blockProps = useBlockProps() useEffect(() => { reloadEventList() }, []) function reloadEventList() { const container = document.getElementById(blockProps.id) if (container) { loadEventList(container) } } function updateEventsCount(event) { let newValue = Number(event.target.value) if (newValue < 1) newValue = 1 setAttributes({ eventsCount: newValue }) reloadEventList() } function updateGroupName(event) { setAttributes({ groupName: event.target.value }) reloadEventList() } return [ ')}> ,
{__('The events could not be loaded!', '')}
{__('The group could not be found!', '')}
{__('Loading...', '')}
, ] }