1- import {
2- CallBackServiceList ,
3- HelloCallServiceList ,
4- TextArea ,
5- } from '../components' ;
1+ import { lazy } from 'react' ;
2+
63import { CALLBACK_SCHEMA , HELLO_CALL_SCHEMA } from '../data' ;
74import { useAcceptedCallBackData , useApplyHelloCallData } from '../hooks' ;
85import { PageLayout } from '@/shared' ;
9- import { Spinner , Flex } from '@chakra-ui/react' ;
6+ import { Flex , Skeleton } from '@chakra-ui/react' ;
107import styled from '@emotion/styled' ;
118
9+ const CallBackServiceList = lazy ( ( ) =>
10+ import (
11+ '../components/common/call-back-service-list/CallBackServiceList'
12+ ) . then ( ( module ) => ( {
13+ default : module . CallBackServiceList ,
14+ } ) )
15+ ) ;
16+
17+ const HelloCallServiceList = lazy ( ( ) =>
18+ import (
19+ '../components/common/hello-call-service-list/HelloCallServiceList'
20+ ) . then ( ( module ) => ( {
21+ default : module . HelloCallServiceList ,
22+ } ) )
23+ ) ;
24+
25+ const TextArea = lazy ( ( ) =>
26+ import ( '../components/features/text-area/TextArea' ) . then ( ( module ) => ( {
27+ default : module . TextArea ,
28+ } ) )
29+ ) ;
30+
1231export const SinittoServiceHistoryPage = ( ) => {
1332 const { acceptedCallBackList, isAcceptedLoading, isAcceptedError } =
1433 useAcceptedCallBackData ( ) ;
@@ -18,15 +37,19 @@ export const SinittoServiceHistoryPage = () => {
1837 return (
1938 < PageLayout >
2039 < Flex flexDir = 'column' w = 'full' gap = 'var(--space-sm)' >
21- < TextArea
22- title = { CALLBACK_SCHEMA . TITLE }
23- status = { CALLBACK_SCHEMA . STATUS }
24- description = { CALLBACK_SCHEMA . DESCRIPTION }
25- textDirection = 'start'
26- />
40+ { isAcceptedLoading ? (
41+ < SkeletonTextArea />
42+ ) : (
43+ < TextArea
44+ title = { CALLBACK_SCHEMA . TITLE }
45+ status = { CALLBACK_SCHEMA . STATUS }
46+ description = { CALLBACK_SCHEMA . DESCRIPTION }
47+ textDirection = 'start'
48+ />
49+ ) }
2750 { isAcceptedLoading ? (
2851 < StyledSpinnerWrapper >
29- < Spinner size = 'lg' thickness = '3px' color = 'blue.500 ' />
52+ < Skeleton height = '50px' width = '100% ' />
3053 </ StyledSpinnerWrapper >
3154 ) : isAcceptedError ? (
3255 < NoServiceMessage >
@@ -46,21 +69,25 @@ export const SinittoServiceHistoryPage = () => {
4669 </ Flex >
4770
4871 < Flex flexDir = 'column' w = 'full' gap = 'var(--space-sm)' >
49- < TextArea
50- title = { HELLO_CALL_SCHEMA . TITLE }
51- status = { [
52- HELLO_CALL_SCHEMA . STATUS_PROCESS ,
53- HELLO_CALL_SCHEMA . STATUS_FINISH ,
54- ] }
55- description = { [
56- HELLO_CALL_SCHEMA . DESCRIPTION_PROCESS ,
57- HELLO_CALL_SCHEMA . DESCRIPTION_FINISH ,
58- ] }
59- textDirection = 'end'
60- />
72+ { isApplyHelloLoading ? (
73+ < SkeletonTextArea />
74+ ) : (
75+ < TextArea
76+ title = { HELLO_CALL_SCHEMA . TITLE }
77+ status = { [
78+ HELLO_CALL_SCHEMA . STATUS_PROCESS ,
79+ HELLO_CALL_SCHEMA . STATUS_FINISH ,
80+ ] }
81+ description = { [
82+ HELLO_CALL_SCHEMA . DESCRIPTION_PROCESS ,
83+ HELLO_CALL_SCHEMA . DESCRIPTION_FINISH ,
84+ ] }
85+ textDirection = 'end'
86+ />
87+ ) }
6188 { isApplyHelloLoading ? (
6289 < StyledSpinnerWrapper >
63- < Spinner size = 'lg' thickness = '3px' color = 'blue.500 ' />
90+ < Skeleton height = '50px' width = '100% ' />
6491 </ StyledSpinnerWrapper >
6592 ) : applyHelloCallList && applyHelloCallList . length > 0 ? (
6693 < Flex w = 'full' flexDir = 'column' gap = 'var(--space-xs)' >
@@ -96,3 +123,5 @@ const NoServiceMessage = styled.p`
96123 color: var(--color-black);
97124 text-align: center;
98125` ;
126+
127+ const SkeletonTextArea = ( ) => < Skeleton height = '150px' width = '100%' /> ;
0 commit comments