@@ -2,7 +2,18 @@ import { useState } from "react";
2
2
3
3
import { type JobSummary } from "@squonk/data-manager-client" ;
4
4
5
- import { Alert , Chip , LinearProgress , Link , MenuItem , TextField , Typography } from "@mui/material" ;
5
+ import { Launch as LaunchIcon } from "@mui/icons-material" ;
6
+ import {
7
+ Alert ,
8
+ Box ,
9
+ Chip ,
10
+ IconButton ,
11
+ LinearProgress ,
12
+ MenuItem ,
13
+ TextField ,
14
+ Tooltip ,
15
+ Typography ,
16
+ } from "@mui/material" ;
6
17
import dynamic from "next/dynamic" ;
7
18
import semver from "semver" ;
8
19
@@ -77,24 +88,57 @@ export const JobCard = ({ projectId, job: jobs, disabled = false }: ApplicationC
77
88
header = { { color : "primary.main" , subtitle : job . name , avatar : job . job [ 0 ] , title : job . job } }
78
89
key = { projectId } // Reset state when project changes
79
90
>
80
- < Typography gutterBottom > { job . description } </ Typography >
81
- < Typography variant = "body2" >
82
- < Link href = { job . doc_url } rel = "noopener noreferrer" target = "_blank" >
83
- docs
84
- </ Link >
91
+ < Typography
92
+ color = "text.secondary"
93
+ sx = { { textTransform : "uppercase" , fontWeight : "bold" } }
94
+ variant = "caption"
95
+ >
96
+ Job
85
97
</ Typography >
86
- < Typography gutterBottom >
87
- { /* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing */ }
88
- < em > { job . category || "<none>" } </ em > : { job . collection }
89
- </ Typography >
90
- < Chips >
91
- { job . keywords ?. map ( ( word ) => (
92
- < Chip color = "primary" key = { word } label = { word } size = "small" variant = "outlined" />
93
- ) ) }
94
- </ Chips >
98
+
99
+ { ! ! job . description && (
100
+ < Typography sx = { { mt : 1 , mb : 2 , textWrap : "pretty" } } variant = "body1" >
101
+ { job . description }
102
+ { ! ! job . doc_url && (
103
+ < Tooltip title = "View documentation" >
104
+ < IconButton
105
+ href = { job . doc_url }
106
+ rel = "noopener noreferrer"
107
+ size = "small"
108
+ sx = { { ml : 0.5 , p : 0.25 , verticalAlign : "middle" } }
109
+ target = "_blank"
110
+ >
111
+ < LaunchIcon sx = { { fontSize : "0.875rem" } } />
112
+ </ IconButton >
113
+ </ Tooltip >
114
+ ) }
115
+ </ Typography >
116
+ ) }
117
+
118
+ < Box sx = { { mb : 2 } } >
119
+ < Typography gutterBottom color = "text.secondary" variant = "body2" >
120
+ Category & Collection :
121
+ </ Typography >
122
+ < Typography variant = "body1" >
123
+ < em > { job . category ?? "No category" } </ em > • { job . collection }
124
+ </ Typography >
125
+ </ Box >
126
+
127
+ { ! ! job . keywords && job . keywords . length > 0 && (
128
+ < Box sx = { { mb : 2 } } >
129
+ < Typography gutterBottom color = "text.secondary" variant = "body2" >
130
+ Keywords:
131
+ </ Typography >
132
+ < Chips >
133
+ { job . keywords . map ( ( word ) => (
134
+ < Chip color = "primary" key = { word } label = { word } size = "small" variant = "outlined" />
135
+ ) ) }
136
+ </ Chips >
137
+ </ Box >
138
+ ) }
95
139
96
140
{ ! ! job . disabled_reason && (
97
- < Alert severity = "warning" sx = { { mt : 1 , mb : - 2 } } >
141
+ < Alert severity = "warning" sx = { { mt : 1 } } >
98
142
{ job . disabled_reason }
99
143
</ Alert >
100
144
) }
0 commit comments