diff --git a/src/components/card/CardProjLoading.tsx b/src/components/card/CardProjLoading.tsx index 9b03f92..0f3e47e 100644 --- a/src/components/card/CardProjLoading.tsx +++ b/src/components/card/CardProjLoading.tsx @@ -1,15 +1,28 @@ import './card-proj-loading.css'; import {Loading3QuartersOutlined} from '@ant-design/icons'; import {IProjLoading} from "../../interfaces/card/ICardProj.ts"; +import {useState} from "react"; + +export default function CardProjLoading(props: IProjLoading) { + + const [duration, setDuration] = useState(props.duration); + + const interval = setInterval(() => { + if (duration <= 0) { + clearInterval(interval); + props.handleCountDownOver(); + return; + } + setDuration(duration - 1000); + }, 1000); -export default function CardProjLoading(props:IProjLoading) { return (