diff --git a/apps/web/lib/components/kanban-card.tsx b/apps/web/lib/components/kanban-card.tsx index a5b0cbeb5..8d0d8c10d 100644 --- a/apps/web/lib/components/kanban-card.tsx +++ b/apps/web/lib/components/kanban-card.tsx @@ -1,13 +1,14 @@ -import BugIcon from "@components/ui/svgs/bug"; import Image from 'next/image'; import VerticalThreeDot from "@components/ui/svgs/vertical-three-dot"; import { DraggableProvided } from "react-beautiful-dnd"; import CircularProgress from "@components/ui/svgs/circular-progress"; import PriorityIcon from "@components/ui/svgs/priority-icon"; import { Tag } from "@app/interfaces"; -import { useTimer } from "@app/hooks"; +import { useTimerView } from "@app/hooks"; import { pad } from "@app/helpers"; import { TaskStatus } from "@app/constants"; +import { useEffect } from "react"; +import { TaskIssueStatus } from "lib/features"; function getStyle(provided: DraggableProvided, style: any) { if (!style) { @@ -139,8 +140,26 @@ export default function Item(props: any) { } = props; const { - fomatedTimeCounter: { hours, minutes, seconds } - } = useTimer(); + hours, + minutes, + seconds, + startTimer, + stopTimer, + timerStatus + } = useTimerView(); + + const handleTime = ()=>{ + if(item.status === TaskStatus.INPROGRESS){ + startTimer() + } else { + stopTimer() + } + + } + + useEffect(()=>{ + handleTime() + },[timerStatus?.running]) return (
- - - + #{item.number} {item.title}