Skip to content

Commit 00154b6

Browse files
committed
allow to remove assignee
1 parent 8775c06 commit 00154b6

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

apps/events/src/components/todos.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,23 @@ export const Todos = () => {
4646
<h2>{todo.name}</h2>
4747
{todo.assignees.length > 0 && (
4848
<span className="text-xs text-gray-500">
49-
Assigned to: {todo.assignees.map((assignee) => assignee.name).join(', ')}
49+
Assigned to:{' '}
50+
{todo.assignees.map((assignee) => (
51+
<span key={assignee.id} className="border rounded-sm mr-1 p-1">
52+
{assignee.name}
53+
<button
54+
type="button"
55+
onClick={() =>
56+
updateEntity(todo.id, {
57+
assignees: todo.assignees.map((assignee) => assignee.id).filter((id) => id !== assignee.id),
58+
})
59+
}
60+
className="cursor-pointer ml-1 text-red-400"
61+
>
62+
x
63+
</button>
64+
</span>
65+
))}
5066
</span>
5167
)}
5268
<input

0 commit comments

Comments
 (0)