HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/bwcsports-site/wp-content/plugins/code-snippets/js/Edit/fields/PriorityInput.tsx
import React from 'react'
import { __ } from '@wordpress/i18n'
import { getSnippetType } from '../../utils/snippets'
import { useSnippetForm } from '../SnippetForm/context'

export const PriorityInput: React.FC = () => {
	const { snippet, setSnippet, isReadOnly } = useSnippetForm()

	return '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>
}