# give/4.17.0/src/EventTickets/resources/blocks/EventTicketsBlock/Edit/BlockPlaceholderSelectEvent.tsx

GiveWP – Donation Plugin and Fundraising Platform, version 4.17.0. 28 lines.

- Page: https://pluginprobe.com/plugins/give/4.17.0/code/src/EventTickets/resources/blocks/EventTicketsBlock/Edit/BlockPlaceholderSelectEvent.tsx
- Raw: https://pluginprobe.com/plugins/give/4.17.0/raw/src/EventTickets/resources/blocks/EventTicketsBlock/Edit/BlockPlaceholderSelectEvent.tsx
- Modified: 2024-03-13T21:54:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.17.0/code/src/EventTickets/resources/blocks/EventTicketsBlock/Edit/BlockPlaceholderSelectEvent.tsx#L10-L20`.

```tsx
import {__} from '@wordpress/i18n';
import {SelectControl} from '@wordpress/components';

/**
 * @since 3.6.0
 */
export default function BlockPlaceholderSelectEvent({attributes, setAttributes}) {
    const {events} = window.eventTicketsBlockSettings;
    const eventOptions =
        events.map((event) => {
            return {label: event.title, value: `${event.id}`};
        }) ?? [];

    return (
        <div className={'givewp-event-tickets-block__placeholder--select-event'}>
            <p>
                <strong>{__('No event selected yet', 'give')}</strong>
            </p>
            <SelectControl
                label={__('Select your preferred event for this donation form', 'give')}
                value={`${attributes.eventId}`}
                options={[{label: 'Select', value: ''}, ...eventOptions]}
                onChange={(value: string) => setAttributes({eventId: Number(value)})}
            />
        </div>
    );
}

```
