2024-03-15 18:18:29 +08:00
|
|
|
|
import './card-proj-loading.css';
|
|
|
|
|
import {Loading3QuartersOutlined} from '@ant-design/icons';
|
|
|
|
|
import {IProjLoading} from "../../interfaces/card/ICardProj.ts";
|
2024-04-12 14:12:38 +08:00
|
|
|
|
import {useEffect, useState} from "react";
|
2024-03-25 19:25:57 +08:00
|
|
|
|
|
|
|
|
|
export default function CardProjLoading(props: IProjLoading) {
|
|
|
|
|
const [duration, setDuration] = useState(props.duration);
|
|
|
|
|
|
2024-04-12 14:12:38 +08:00
|
|
|
|
useEffect(() => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const last = duration - 1000;
|
|
|
|
|
if (last <= 0) {
|
|
|
|
|
setDuration(0);
|
|
|
|
|
props.handleCountDownOver();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
setDuration(last);
|
|
|
|
|
}, 1000);
|
|
|
|
|
}, [duration])
|
2024-03-15 18:18:29 +08:00
|
|
|
|
|
|
|
|
|
return (
|
2024-04-25 15:37:50 +08:00
|
|
|
|
<div className="card-proj-loading" onClick={() => {
|
|
|
|
|
if (!props.handleClick) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
props.handleClick();
|
|
|
|
|
}}>
|
2024-03-15 18:18:29 +08:00
|
|
|
|
<div className="title">
|
|
|
|
|
<Loading3QuartersOutlined spin={true} style={{color: '#0052d9'}}/>
|
|
|
|
|
<span className="label">{props.title}</span>
|
|
|
|
|
</div>
|
2024-03-26 11:54:30 +08:00
|
|
|
|
<div className="desc">{props.desc},预计等待{duration / 1000}s</div>
|
2024-03-15 18:18:29 +08:00
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|