mirasim's picture
Add the tasks, judges, harness, app under test, docs and report; merge the repository README into the card (part 4)
714ed7b verified
Raw History Blame Contribute Delete
957 Bytes
import { Link } from "react-router-dom";
import type { Task } from "../types";
import { CommentCount } from "./CommentCount";
import { PriorityBadge } from "./PriorityBadge";
export function TaskRow({
task,
onToggle,
onEdit,
onDelete,
}: {
task: Task;
onToggle: () => void;
onEdit: () => void;
onDelete: () => void;
}) {
return (
<li className={task.done ? "task done" : "task"} data-task-id={task.id}>
<input type="checkbox" checked={task.done} onChange={onToggle} aria-label={`Complete ${task.title}`} />
<Link className="title" to={`/tasks/${task.id}`}>
{task.title}
</Link>
<CommentCount count={task.commentCount} />
<PriorityBadge priority={task.priority} />
<button onClick={onEdit} aria-label={`Edit ${task.title}`}>
Edit
</button>
<button className="danger" onClick={onDelete} aria-label={`Delete ${task.title}`}>
Delete
</button>
</li>
);
}