HEX
Server: LiteSpeed
System: Linux 112.webhostingindonesia.co.id 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
User: iyfwylsv (10313)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/lotushomemade.com/httpdocs/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>
}