diff --git a/src/pages/analysis-jobs/index.tsx b/src/pages/analysis-jobs/index.tsx index 886c8cc..7978fba 100644 --- a/src/pages/analysis-jobs/index.tsx +++ b/src/pages/analysis-jobs/index.tsx @@ -11,6 +11,7 @@ import api from '../../utils/api' import { AxiosResponse } from 'axios' import { ModalActionType, AnalysisJob } from '../../types' import Layout from '../../components/layout' +import Loader from '../../components/loader' import CtaButton from '../../components/cta-button' import { ActionType as AlertActionType } from '../../store/alert/action-types' import ProgressPill from '../../components/progress-pill' @@ -27,6 +28,7 @@ interface GetAnalysisJobValues { const AnalysisJobsPage = (): ReactElement => { const { dispatch } = useContext(Store) const [analysisJobs, setAnalysisJobs] = useState([]) + const [isLoading, setIsLoading] = useState(false) const [createAnalysisJobformValues, setCreateAnalysisJobformValues] = useState({ postcode: '' @@ -149,6 +151,8 @@ const AnalysisJobsPage = (): ReactElement => { setAnalysisJobs(data) } catch (err) { console.log(err) + } finally { + setIsLoading(false) } } @@ -200,83 +204,87 @@ const AnalysisJobsPage = (): ReactElement => {

Analysis Jobs

-
-
-
- - - - - - - - - - - - {!!analysisJobs.length && - analysisJobs.map((n) => ( - - - - - - - - ))} - -
- Created - - Postcode - - Transaction price - - Complete - - Action -
-
- {new Date(Date.parse(n.created)).toLocaleString()} -
-
-
- {n.postcode} -
-
-
- {`£${n.transactionPrice.toLocaleString()}`} -
-
-
- -
-
- -
+ {isLoading ? ( + + ) : ( +
+
+
+ + + + + + + + + + + + {!!analysisJobs.length && + analysisJobs.map((n) => ( + + + + + + + + ))} + +
+ Created + + Postcode + + Transaction price + + Complete + + Action +
+
+ {new Date(Date.parse(n.created)).toLocaleString()} +
+
+
+ {n.postcode} +
+
+
+ {`£${n.transactionPrice.toLocaleString()}`} +
+
+
+ +
+
+ +
+
-
+ )}
)