-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLoading.tsx
More file actions
38 lines (32 loc) · 993 Bytes
/
Loading.tsx
File metadata and controls
38 lines (32 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Lottie from 'lottie-react';
import loadingAnimation from '@/assets/lottie/loading.json';
import * as styles from '@/common/component/Loading/Loading.css';
type LoadingProps = {
type: 'goal' | 'todo' | 'history' | 'entireTodo';
};
const Loading = ({ type }: LoadingProps) => {
let message = '';
switch (type) {
case 'goal':
message = 'AI가 목표를 추천해주고 있어요';
break;
case 'todo':
message = 'AI가 할 일을 추천해주고 있어요';
break;
case 'history':
message = '내가 한 일을 불러오고 있어요';
break;
case 'entireTodo':
message = '목표를 작성중입니다';
break;
}
return (
<div className={styles.loadingOverlay}>
<div className={styles.loadingContainer}>
<Lottie className={styles.loadingLottie} animationData={loadingAnimation} />
<p className={styles.loadingText}>{message}</p>
</div>
</div>
);
};
export default Loading;