diff --git a/src/components/Board/AddTask.tsx b/src/components/Board/AddTask.tsx index ecc8233d..e660d3dd 100644 --- a/src/components/Board/AddTask.tsx +++ b/src/components/Board/AddTask.tsx @@ -94,7 +94,7 @@ export default function AddTask({ handleClose, tasks }: Props) { name: tasks.name, description: tasks.description, category: tasks.category, - time_saved: tasks.time_saved, + stats: tasks.stats, techniques: tasks.techniques, subtasks: tasks.subtasks, } @@ -102,7 +102,7 @@ export default function AddTask({ handleClose, tasks }: Props) { id: generateRandomNumber(), name: "", description: "", - time_saved: "", + stats: [], category: selectedColumn, techniques: [], subtasks: [], diff --git a/src/components/Board/TaskDetails.tsx b/src/components/Board/TaskDetails.tsx index 561ab218..a23d08f9 100644 --- a/src/components/Board/TaskDetails.tsx +++ b/src/components/Board/TaskDetails.tsx @@ -94,11 +94,15 @@ export default function TaskDetails({

A{tasks.id}

-
- {tasks.time_saved && ( -
-

Time saved: {tasks.time_saved}

-
+ + {tasks.stats && ( + <> + {tasks.stats.map((stat: { name: string; value: string }, index: number) => ( +

+ {`${stat.name}: ${stat.value}`} +

+ ))} + )}

diff --git a/src/components/Board/TaskItem.tsx b/src/components/Board/TaskItem.tsx index bfc2b1d4..c81f57ad 100644 --- a/src/components/Board/TaskItem.tsx +++ b/src/components/Board/TaskItem.tsx @@ -5,7 +5,6 @@ import AddTask from "./AddTask"; import TaskDetails from "./TaskDetails"; import { Draggable } from "@hello-pangea/dnd"; import { BsCircleFill } from "react-icons/bs"; -// import { randomColor } from "utilis"; interface Props { tasks: ITask; @@ -39,7 +38,6 @@ export default function TaskItem({ tasks, index }: Props) { {tasks.subtasks.map((subtask, index) => (

- {" "} {subtask.title}

@@ -48,15 +46,17 @@ export default function TaskItem({ tasks, index }: Props) {

{tasks.name}

- {" "} A{tasks.id}

- {tasks.time_saved && ( -

- {" "} - Time saved: {tasks.time_saved} -

+ {tasks.stats && ( + <> + {tasks.stats.map((stat: { name: string; value: string }, index: number) => ( +

+ {`${stat.name}: ${stat.value}`} +

+ ))} + )}

diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 78550f10..7d74bde2 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -9,7 +9,7 @@ export interface IBoard { name: string; description: string; category: string; - time_saved: string; + stats: IStat[]; techniques: string[]; subtasks: { id:string, title: string; @@ -19,6 +19,11 @@ export interface IBoard { }[]; } +export interface IStat { + name: string; + value: string; +} + export interface IColumn { name: string; id:string, @@ -27,7 +32,7 @@ export interface IColumn { name: string; description: string; category: string; - time_saved: string; + stats: IStat[]; techniques: string[]; subtasks: { id:string, @@ -42,7 +47,7 @@ export interface ITask { name: string; description: string; category: string; - time_saved: string; + stats: IStat[]; techniques: string[]; subtasks: { id:string,