HEX
Server: LiteSpeed
System: Linux server318.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: sahadove (2893)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/sahadove/wp-content/plugins/extendify/src/Assist/components/dashboard/buttons/EventButton.jsx
import { useTasksStore } from '@assist/state/tasks';

export const EventButton = ({ task, completed }) => {
	const { completeTask } = useTasksStore();

	return (
		<button
			type="button"
			className="min-w-24 rounded-sm bg-design-main px-4 py-2.5 text-sm font-medium text-design-text hover:opacity-90"
			onClick={() => {
				window.dispatchEvent(task.event);
				completeTask(task.slug);
			}}>
			{completed ? task.buttonLabels.completed : task.buttonLabels.notCompleted}
		</button>
	);
};