| 1 |
import { useTasksStore } from '@assist/state/tasks'; |
| 2 |
|
| 3 |
export const EventButton = ({ task, completed }) => { |
| 4 |
const { completeTask } = useTasksStore(); |
| 5 |
|
| 6 |
return ( |
| 7 |
<button |
| 8 |
type="button" |
| 9 |
className="min-w-24 rounded-xs bg-design-main px-4 py-2.5 text-sm font-medium text-design-text hover:opacity-90" |
| 10 |
onClick={() => { |
| 11 |
window.dispatchEvent(task.event); |
| 12 |
completeTask(task.slug); |
| 13 |
}} |
| 14 |
> |
| 15 |
{completed ? task.buttonLabels.completed : task.buttonLabels.notCompleted} |
| 16 |
</button> |
| 17 |
); |
| 18 |
}; |
| 19 |
|