diff --git a/frontend/src/components/EisenhowerMatrix/Eisenhower.jsx b/frontend/src/components/EisenhowerMatrix/Eisenhower.jsx index 8dc159a..7c31328 100644 --- a/frontend/src/components/EisenhowerMatrix/Eisenhower.jsx +++ b/frontend/src/components/EisenhowerMatrix/Eisenhower.jsx @@ -1,22 +1,34 @@ -import React from "react"; +import React, { useState } from "react"; import { FiAlertCircle, FiClock, FiXCircle, FiCheckCircle } from "react-icons/fi"; function EachBlog({ name, colorCode, contentList, icon }) { + const [tasks, setTasks] = useState(contentList); + + const handleCheckboxChange = index => { + const updatedTasks = [...tasks]; + updatedTasks[index].checked = !updatedTasks[index].checked; + setTasks(updatedTasks); + }; + return ( -
-
- {icon} - {name} +
+
+ {icon} + {name}

- {contentList.length === 0 ? ( + {tasks.length === 0 ? (

No tasks

) : ( - contentList.map((item, index) => ( + tasks.map((item, index) => (
- + handleCheckboxChange(index)} + />
))