$99 GRAYBYTE WORDPRESS FILE MANAGER $32

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/Draft/components/

HOME
Current File : /home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/Draft/components//Input.jsx
import { Spinner } from '@wordpress/components';
import { __, isRTL } from '@wordpress/i18n';
import { arrowRight, Icon, arrowLeft } from '@wordpress/icons';
import classnames from 'classnames';
import { DynamicTextarea } from '@draft/components/DynamicTextarea';
import { useSelectedText } from '@draft/hooks/useSelectedText';
import { magic } from '@draft/svg';

export const Input = ({
	inputText,
	setInputText,
	ready,
	setReady,
	setPrompt,
	loading,
}) => {
	const { selectedText } = useSelectedText();

	const submit = (event) => {
		event.preventDefault();

		if (!ready || loading) return;

		setInputText('');
		setReady(false);

		setPrompt({
			text: selectedText ? selectedText : inputText,
			promptType: selectedText ? 'custom-requests' : 'create',
			systemMessageKey: selectedText ? 'edit' : 'generate',
			// The prompt as a followup to the user's input
			details: { followup: selectedText ? inputText : undefined },
		});
	};

	return (
		<form className="relative flex items-start" onSubmit={submit}>
			<Icon
				icon={magic}
				className="absolute left-2 top-3.5 h-5 w-5 fill-current text-wp-theme-main rtl:left-auto rtl:right-2"
			/>
			<DynamicTextarea
				disabled={loading}
				placeholder={
					loading
						? __('AI is writing...', 'extendify-local')
						: selectedText
							? __('Ask AI to edit', 'extendify-local')
							: __('Ask AI to generate text', 'extendify-local')
				}
				value={inputText}
				className="h-full w-full resize-none overflow-hidden rounded-none border-transparent bg-transparent px-10 py-3 outline-none focus:ring-1 focus:ring-wp-theme-main"
				onChange={(event) => {
					setInputText(event.target.value);
					setReady(event.target.value.length > 0);
				}}
				onKeyDown={(event) => {
					if (event.key === 'Enter' && !event.shiftKey) {
						event.preventDefault();
						submit(event);
					}
				}}
			/>
			{loading && (
				<div className="absolute right-4 top-3.5 h-4 w-4 p-1 text-gray-700 rtl:left-4 rtl:right-auto">
					<Spinner style={{ margin: '0' }} />
				</div>
			)}
			{!loading && (
				<button
					type="submit"
					disabled={!ready}
					aria-label={__('Submit', 'extendify-local')}
					className={classnames(
						'absolute right-2 top-3.5 border-none bg-transparent p-0 rtl:left-2 rtl:right-auto',
						{
							'text-gray-700 hover:text-design-main': ready,
							'text-gray-500': !ready,
						},
					)}>
					<Icon
						icon={isRTL() ? arrowLeft : arrowRight}
						onClick={submit}
						className="h-6 w-6 fill-current"
					/>
				</button>
			)}
		</form>
	);
};


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
image-generation
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
stock-images
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
Completion.jsx
0.599 KB
16 Jul 2024 11.59 PM
bravrvjk / bravrvjk
0644
ConsentSidebar.jsx
0.765 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
DraftMenu.jsx
1.219 KB
4 Mar 2024 10.54 AM
bravrvjk / bravrvjk
0644
DynamicTextarea.jsx
2.137 KB
16 Jul 2024 11.59 PM
bravrvjk / bravrvjk
0644
EditMenu.jsx
2.359 KB
3 Dec 2024 1.47 AM
bravrvjk / bravrvjk
0644
GenerateImageButtons.jsx
5.097 KB
26 Mar 2025 6.03 PM
bravrvjk / bravrvjk
0644
Input.jsx
2.51 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
InsertMenu.jsx
7.491 KB
15 Sep 2025 11.30 PM
bravrvjk / bravrvjk
0644
SelectedText.jsx
1.67 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
ToolbarMenu.jsx
5 KB
3 Dec 2024 1.47 AM
bravrvjk / bravrvjk
0644
TranslationDropdown.jsx
6.226 KB
4 Aug 2025 7.41 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF