@@ -12,13 +12,13 @@ import Cookies from "js-cookie";
12
12
import { useSnackbar } from "notistack" ;
13
13
import axios from "axios" ;
14
14
import * as ReactBootStrap from "react-bootstrap" ;
15
- import NotLoggedIn from "../notLoggedIn/NotLoggedIn" ;
16
15
17
16
export default function ParticularSiteCharges ( ) {
18
17
const { enqueueSnackbar, closeSnackbar } = useSnackbar ( ) ;
19
18
const router = useRouter ( ) ;
20
19
const { dispatch, state } = useContext ( Store ) ;
21
20
const [ loading , setLoading ] = useState ( false ) ;
21
+
22
22
// console.log(router.query?.site_id);
23
23
// var address =
24
24
// state.?.site_id?.address?.first_line +
@@ -88,88 +88,70 @@ export default function ParticularSiteCharges() {
88
88
89
89
return (
90
90
< >
91
- { ! Cookies . get ( "userInfo" ) ? (
92
- // <NotLoggedIn />
93
- < span > You are not logged in</ span >
94
- ) : (
95
- < div >
96
- < Head >
97
- < title > Site Charges</ title >
98
- </ Head >
99
- { loading ? (
100
- < >
101
- < div className = "Parent" >
102
- < Taskbar />
103
- < div className = "S_right" >
91
+ < Head >
92
+ < title > Site Charges</ title >
93
+ </ Head >
94
+ { loading ? (
95
+ < >
96
+ < div className = "Parent" >
97
+ < Taskbar />
98
+ < div className = "S_right" >
99
+ < div >
100
+ < link
101
+ rel = "stylesheet"
102
+ href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
103
+ integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
104
+ crossOrigin = "anonymous"
105
+ > </ link >
106
+ < link
107
+ rel = "stylesheet"
108
+ href = "https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
109
+ integrity = "sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
110
+ crossOrigin = "anonymous"
111
+ />
112
+ { state . particularSiteCharges ?. length <= 0 ? (
104
113
< div >
105
- < link
106
- rel = "stylesheet"
107
- href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
108
- integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
109
- crossOrigin = "anonymous"
110
- > </ link >
111
- < link
112
- rel = "stylesheet"
113
- href = "https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
114
- integrity = "sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
115
- crossOrigin = "anonymous"
114
+ < Header header = "Total Charges" />
115
+ No charges to display
116
+ </ div >
117
+ ) : (
118
+ < div className = "p_right" >
119
+ < Header header = "Total Charges" />
120
+
121
+ < NameLabel
122
+ label = "Alias Name"
123
+ details = {
124
+ state . particularSiteCharges [ 0 ] ?. site_id ?. alias_name
125
+ }
116
126
/>
117
- { ! router . query ?. site_id ? (
118
- < div >
119
- < Header header = "Total Charges" />
120
- < div className = "container shadow text-center p-5 mt-5" >
121
- < strong > Site Not Found</ strong >
122
- </ div >
123
- </ div >
124
- ) : state . particularSiteCharges ?. length <= 0 ? (
125
- < div >
126
- < Header header = "Total Charges" />
127
- < div className = "container shadow text-center p-5 mt-5" >
128
- < strong > No charges to display</ strong >
129
- </ div >
130
- </ div >
131
- ) : (
132
- < div className = "p_right" >
133
- < Header header = "Total Charges" />
127
+ < NameLabel
128
+ label = "Type"
129
+ details = { state . particularSiteCharges [ 0 ] ?. site_id ?. Type }
130
+ />
131
+ < NameLabel label = "Address" details = { getAddress ( ) } />
134
132
135
- < NameLabel
136
- label = "Alias Name"
137
- details = {
138
- state . particularSiteCharges [ 0 ] ?. site_id ?. alias_name
139
- }
140
- />
141
- < NameLabel
142
- label = "Type"
143
- details = {
144
- state . particularSiteCharges [ 0 ] ?. site_id ?. Type
145
- }
133
+ { state . particularSiteCharges . map ( ( data , index ) => {
134
+ console . log ( data ) ;
135
+ return (
136
+ < TotalchargesCard
137
+ key = { index }
138
+ description = { data . description }
139
+ siteDetails = { data . site_id }
146
140
/>
147
- < NameLabel label = "Address" details = { getAddress ( ) } />
148
-
149
- { state . particularSiteCharges . map ( ( data , index ) => {
150
- console . log ( data ) ;
151
- return (
152
- < TotalchargesCard
153
- key = { index }
154
- description = { data . description }
155
- siteDetails = { data . site_id }
156
- />
157
- ) ;
158
- } ) }
159
- </ div >
160
- ) }
161
- < div className = "tc" >
162
- < Image src = { Total_Charges } alt = "TC" />
163
- </ div >
141
+ ) ;
142
+ } ) }
164
143
</ div >
144
+ ) }
145
+ < div className = "tc" >
146
+ < Image src = { Total_Charges } alt = "TC" />
165
147
</ div >
166
148
</ div >
167
- </ >
168
- ) : (
169
- < div className = "p_spinner" >
170
- < ReactBootStrap . Spinner animation = "border" />
171
149
</ div >
172
- ) }
150
+ </ div >
151
+ </ >
152
+ ) : (
153
+ < div className = "p_spinner" >
154
+ < ReactBootStrap . Spinner animation = "border" />
173
155
</ div >
174
156
) }
175
157
</ >
0 commit comments