# wp-parsely/3.14.1/src/content-helper/common/select.tsx

Parse.ly, version 3.14.1. 35 lines.

- Page: https://pluginprobe.com/plugins/wp-parsely/3.14.1/code/src/content-helper/common/select.tsx
- Raw: https://pluginprobe.com/plugins/wp-parsely/3.14.1/raw/src/content-helper/common/select.tsx
- Modified: 2023-09-25T12:24:24+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/wp-parsely/3.14.1/code/src/content-helper/common/select.tsx#L10-L20`.

```tsx
/**
 * Defines the props structure for FilterSelect.
 *
 * @since 3.10.0
 */
interface FilterSelectProps {
	defaultValue?: string;
	items: [value: string, label: string][];
	onChange: ( event: React.ChangeEvent<HTMLSelectElement> ) => void;
}

/**
 * Returns a select element according to the passed props.
 *
 * @since 3.10.0
 *
 * @param {FilterSelectProps} props The component's props.
 *
 * @return {JSX.Element} The JSX Element.
 */
export const Select = (
	{ defaultValue, items, onChange }: FilterSelectProps
): JSX.Element => {
	return (
		<select onChange={ onChange } value={ defaultValue }>
			{ items.map( ( item ) => (
				<option
					key={ item[ 0 ] }
					value={ item[ 0 ] }>{ item[ 1 ] }
				</option>
			) ) }
		</select>
	);
};

```
