File tree Expand file tree Collapse file tree
src/app/(dashboard)/projects/[projectId]/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,9 +143,10 @@ const ServicesPage = () => {
143143 < div >
144144 < h1 className = "mb-4 text-lg font-bold" > Services</ h1 >
145145 < div className = "grid gap-4 lg:grid-cols-2" >
146- { services . map ( ( service ) => (
147- < Link key = { service . name } href = { service . href } className = "block" >
148- < Card className = "flex flex-col h-full hover:border-primary/50 transition-colors cursor-pointer" >
146+ { services . map ( ( service ) => {
147+ const canAccess = ! service . adminOnly || isAdmin ;
148+ const card = (
149+ < Card className = "flex flex-col h-full hover:border-primary/50 transition-colors" >
149150 < CardHeader >
150151 < div className = "flex items-center justify-between gap-3" >
151152 < CardTitle > { service . name } </ CardTitle >
@@ -224,16 +225,23 @@ const ServicesPage = () => {
224225 </ div >
225226 </ div >
226227 ) : null }
227- { ( ! service . adminOnly || isAdmin ) && (
228+ { canAccess && (
228229 < div className = "mt-auto flex items-center text-sm text-primary" >
229230 View { service . name . toLowerCase ( ) }
230231 < ArrowRight className = "ml-2 h-4 w-4" />
231232 </ div >
232233 ) }
233234 </ CardContent >
234235 </ Card >
235- </ Link >
236- ) ) }
236+ ) ;
237+ return canAccess ? (
238+ < Link key = { service . name } href = { service . href } className = "block" >
239+ { card }
240+ </ Link >
241+ ) : (
242+ < div key = { service . name } > { card } </ div >
243+ ) ;
244+ } ) }
237245 </ div >
238246 </ div >
239247 ) ;
You can’t perform that action at this time.
0 commit comments