{
+ openActivityRightDrawer(task.id);
+ }}
+ >
+ {
+ e.stopPropagation();
+ }}
+ >
+
+
+ {task.title}
+ {task.comments && task.comments.length > 0 && (
+
+
+
+ )}
+
+
+
+
+ {task.dueAt && beautifyExactDate(task.dueAt)}
+
+
+ );
+}
diff --git a/front/src/modules/tasks/hooks/useTasks.ts b/front/src/modules/tasks/hooks/useTasks.ts
new file mode 100644
index 0000000000..2dd2d5c890
--- /dev/null
+++ b/front/src/modules/tasks/hooks/useTasks.ts
@@ -0,0 +1,47 @@
+import { activeTabIdScopedState } from '@/ui/tab/states/activeTabIdScopedState';
+import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
+import { ActivityType, useGetActivitiesQuery } from '~/generated/graphql';
+import { parseDate } from '~/utils/date-utils';
+
+import { TasksContext } from '../states/TasksContext';
+
+export function useTasks() {
+ const [activeTabId] = useRecoilScopedState(
+ activeTabIdScopedState,
+ TasksContext,
+ );
+
+ const { data, loading } = useGetActivitiesQuery({
+ variables: {
+ where: {
+ type: { equals: ActivityType.Task },
+ completedAt:
+ activeTabId === 'done' ? { not: { equals: null } } : { equals: null },
+ },
+ },
+ });
+
+ const todayTasks = data?.findManyActivities.filter((task) => {
+ if (!task.dueAt) {
+ return false;
+ }
+ const dueDate = parseDate(task.dueAt).toJSDate();
+ const today = new Date();
+ return dueDate.getDate() === today.getDate();
+ });
+
+ const otherTasks = data?.findManyActivities.filter((task) => {
+ if (!task.dueAt) {
+ return false;
+ }
+ const dueDate = parseDate(task.dueAt).toJSDate();
+ const today = new Date();
+ return dueDate.getDate() !== today.getDate();
+ });
+
+ return {
+ todayTasks,
+ otherTasks,
+ loading,
+ };
+}
diff --git a/front/src/modules/tasks/states/TasksContext.ts b/front/src/modules/tasks/states/TasksContext.ts
new file mode 100644
index 0000000000..b8dd7264e0
--- /dev/null
+++ b/front/src/modules/tasks/states/TasksContext.ts
@@ -0,0 +1,3 @@
+import { createContext } from 'react';
+
+export const TasksContext = createContext