HoangHai-portliofio-projects / Projects / 6.TodoApp.fullStack.React+Springboot / react-fe / src / components / task.js
task.js
Raw
import React from "react";

const Task = ({ task, onDelete, onToggle }) => {
	return (
		<div
			className={`task ${task.reminder ? 'reminder':''}`}
			onDoubleClick={() => onToggle(task.id)}
		>
			<h3>
				{task.text}{" "}
				<button
					className="btn btn-danger"
					style={{ cursor: "pointer" }}
					onClick={() => onDelete(task.id)}
				>
					x
				</button>
			</h3>
			<p>{task.day}</p>
		</div>
	);
};

export default Task;