@@ -4,6 +4,7 @@ import { Handle, type NodeProps } from 'reactflow';
4
4
import Shape from '../components/Shape' ;
5
5
import ErrorMessage from '../components/ErrorMessage' ;
6
6
import { nodeIconStyles , nodeLabelStyles } from '../styles' ;
7
+ import { SparklesIcon } from '@heroicons/react/24/outline' ;
7
8
8
9
type NodeData = any ;
9
10
@@ -23,6 +24,7 @@ type ErrorObject = {
23
24
24
25
type LabelProps = React . PropsWithChildren < {
25
26
hasErrors ?: boolean ;
27
+ hasAi ?: boolean ;
26
28
} > ;
27
29
28
30
function errorsMessage ( errors : ErrorObject ) : string {
@@ -39,16 +41,19 @@ const hasErrors = (errors: ErrorObject | null | undefined): boolean => {
39
41
return Object . values ( errors ) . some ( errorArray => errorArray . length > 0 ) ;
40
42
} ;
41
43
42
- const Label : React . FC < LabelProps > = ( { children, hasErrors = false } ) => {
44
+ const Label : React . FC < LabelProps > = ( { children, hasErrors = false , hasAi = false } ) => {
43
45
const textColorClass = hasErrors ? 'text-red-500' : '' ;
44
46
45
47
if ( children && ( children as any ) . length ) {
46
48
return (
47
- < p
48
- className = { `line-clamp-2 align-left text-m max-w-[275px] text-ellipsis overflow-hidden ${ textColorClass } ` }
49
- >
50
- { children }
51
- </ p >
49
+ < div className = 'inline-flex' >
50
+ < p
51
+ className = { `flex line-clamp-2 align-left text-m max-w-[275px] text-ellipsis overflow-hidden ${ textColorClass } ` }
52
+ >
53
+ { children }
54
+ </ p >
55
+ { hasAi ? < SparklesIcon title = 'AI chat was used in this job' className = 'w-5 h-5 ml-1' color = "#FF5722" /> : null }
56
+ </ div >
52
57
) ;
53
58
}
54
59
return null ;
@@ -225,7 +230,7 @@ const Node = ({
225
230
/>
226
231
) }
227
232
< div className = "flex flex-col flex-1 ml-2 mt-8" >
228
- < Label hasErrors = { hasErrors ( errors ) } > { label } </ Label >
233
+ < Label hasErrors = { hasErrors ( errors ) } hasAi = { ! ! data . has_ai_chat } > { label } </ Label >
229
234
< SubLabel > { sublabel } </ SubLabel >
230
235
{ data . isActiveDropTarget &&
231
236
typeof data . dropTargetError === 'string' && (
@@ -245,10 +250,9 @@ const Node = ({
245
250
justifyContent : 'center' ,
246
251
} }
247
252
className = { `flex flex-row items-center
248
- opacity-0 ${
249
- ( ! data . isActiveDropTarget && 'group-hover:opacity-100' ) ??
250
- ''
251
- }
253
+ opacity-0 ${ ( ! data . isActiveDropTarget && 'group-hover:opacity-100' ) ??
254
+ ''
255
+ }
252
256
transition duration-150 ease-in-out` }
253
257
>
254
258
{ toolbar ( ) }
0 commit comments