# code-snippets/3.5.0/js/Edit/fields/PriorityInput.tsx

Code Snippets, version 3.5.0. 25 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/3.5.0/code/js/Edit/fields/PriorityInput.tsx
- Raw: https://pluginprobe.com/plugins/code-snippets/3.5.0/raw/js/Edit/fields/PriorityInput.tsx
- Modified: 2023-09-13T15:41:38+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/code-snippets/3.5.0/code/js/Edit/fields/PriorityInput.tsx#L10-L20`.

```tsx
import React from 'react'
import { __ } from '@wordpress/i18n'
import { SnippetInputProps } from '../../types/SnippetInputProps'
import { getSnippetType } from '../../utils/snippets'

export const PriorityInput: React.FC<SnippetInputProps> = ({ snippet, setSnippet, isReadOnly }) =>
	'html' === getSnippetType(snippet) ? null :
		<p
			className="snippet-priority"
			title={__('Snippets with a lower priority number will run before those with a higher number.', 'code-snippets')}
		>
			<label htmlFor="snippet_priority">{`${__('Priority', 'code-snippets')} `}</label>
			<input
				type="number"
				id="snippet_priority"
				name="snippet_priority"
				value={snippet.priority}
				disabled={isReadOnly}
				onChange={event => setSnippet(previous => ({
					...previous,
					priority: parseInt(event.target.value, 10)
				}))}
			/>
		</p>

```
