From 6f470ec38cf18e8943e7ccd8a09cbf71f6d1d534 Mon Sep 17 00:00:00 2001 From: Sujit Date: Mon, 12 Aug 2024 09:10:40 +0545 Subject: [PATCH] feat(dashboard): create TaskLogsTable --- .../Dashboard/TaskLogs/TaskLogsTable.tsx | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/frontend/src/components/Dashboard/TaskLogs/TaskLogsTable.tsx diff --git a/src/frontend/src/components/Dashboard/TaskLogs/TaskLogsTable.tsx b/src/frontend/src/components/Dashboard/TaskLogs/TaskLogsTable.tsx new file mode 100644 index 00000000..eaac4eab --- /dev/null +++ b/src/frontend/src/components/Dashboard/TaskLogs/TaskLogsTable.tsx @@ -0,0 +1,58 @@ +import { format } from 'date-fns'; +import { useNavigate } from 'react-router-dom'; + +interface ITaskLogsTableProps { + data: any[]; +} + +const TaskLogsTable = ({ data: taskList }: ITaskLogsTableProps) => { + const navigate = useNavigate(); + return ( +
+ + + + + + + + + + + + {taskList?.map(task => ( + + + + + + + + + ))} + +
+ ID + + Total task area + + Est.flight time + + Created Date + + Status + +
{task.task_id}{task.task_area}-{format(new Date(task.created_at), 'yyyy-MM-dd')}{task.state} +
navigate(`/tasks/${task.task_id}`)} + > + zoom_in +
+
+
+ ); +}; + +export default TaskLogsTable;