$30 GRAYBYTE WORDPRESS FILE MANAGER $84

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/HelpCenter/components/ai-chat/

HOME
Current File : /home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/HelpCenter/components/ai-chat//Rating.jsx
import { useState, useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import classnames from 'classnames';
import { thumbUp, thumbDown } from '@help-center/components/ai-chat/icons';
import { rateAnswer } from '@help-center/lib/api';

export const Rating = ({ answerId }) => {
	const [rating, setRating] = useState(undefined);

	useEffect(() => {
		if (!answerId) return;
		if (rating === undefined) return;
		rateAnswer({ answerId, rating });
	}, [rating, answerId]);

	return (
		<div className="mt-1 flex items-center justify-end gap-0.5 text-right">
			<button
				type="button"
				aria-pressed={rating === 1}
				aria-live="polite"
				onClick={() => setRating((current) => (current === 1 ? 0 : 1))}
				aria-label={
					rating === 1
						? __('Remove rating', 'extendify-local')
						: __('Rate that this answer was helpful', 'extendify-local')
				}
				className={classnames(
					'm-0 h-5 w-5 border-0 bg-transparent p-0 hover:text-design-main',
					{
						'text-design-main': rating === 1,
						'text-gray-500': rating !== 1,
					},
				)}>
				<Icon className="fill-current" icon={thumbUp} />
			</button>

			<button
				type="button"
				aria-pressed={rating === -1}
				aria-live="polite"
				onClick={() => setRating((current) => (current === -1 ? 0 : -1))}
				aria-label={
					rating === -1
						? __('Remove rating', 'extendify-local')
						: __('Rate that this answer was not helpful', 'extendify-local')
				}
				className={classnames(
					'm-0 h-5 w-5 border-0 bg-transparent p-0 hover:text-design-main',
					{
						'text-design-main': rating === -1,
						'text-gray-500': rating !== -1,
					},
				)}>
				<Icon className="fill-current" icon={thumbDown} />
			</button>
		</div>
	);
};


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
Answer.jsx
2.817 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
DynamicTextarea.jsx
2.628 KB
3 Dec 2024 1.47 AM
bravrvjk / bravrvjk
0644
Error.jsx
0.474 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
History.jsx
2.229 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
Nav.jsx
2.106 KB
22 Apr 2025 9.31 PM
bravrvjk / bravrvjk
0644
Question.jsx
1.593 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
Rating.jsx
1.75 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
icons.jsx
6.779 KB
14 Mar 2024 8.40 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF