1
+ import classNames from 'classnames'
1
2
import { useStarCapture } from 'data-services/hooks/captures/useStarCapture'
2
3
import { usePipelines } from 'data-services/hooks/pipelines/usePipelines'
3
4
import { useProjectDetails } from 'data-services/hooks/projects/useProjectDetails'
@@ -10,7 +11,9 @@ import { IconType } from 'design-system/components/icon/icon'
10
11
import { Select , SelectTheme } from 'design-system/components/select/select'
11
12
import { Tooltip } from 'design-system/components/tooltip/tooltip'
12
13
import { useState } from 'react'
13
- import { useParams } from 'react-router-dom'
14
+ import { Link , useParams } from 'react-router-dom'
15
+ import { APP_ROUTES } from 'utils/constants'
16
+ import { getAppRoute } from 'utils/getAppRoute'
14
17
import { STRING , translate } from 'utils/language'
15
18
import { useUser } from 'utils/user/userContext'
16
19
import styles from './capture-details.module.scss'
@@ -24,6 +27,7 @@ export const CaptureDetails = ({
24
27
captureId : string
25
28
} ) => {
26
29
const { user } = useUser ( )
30
+ const { projectId } = useParams ( )
27
31
28
32
if ( ! capture ) {
29
33
return null
@@ -69,6 +73,25 @@ export const CaptureDetails = ({
69
73
< JobControls capture = { capture } />
70
74
</ div >
71
75
) }
76
+ < div >
77
+ < span className = { styles . label } >
78
+ { translate ( STRING . FIELD_LABEL_JOBS ) }
79
+ </ span >
80
+ < Link
81
+ to = { getAppRoute ( {
82
+ to : APP_ROUTES . JOBS ( {
83
+ projectId : projectId as string ,
84
+ } ) ,
85
+ filters : {
86
+ source_image_single : capture . id ,
87
+ } ,
88
+ } ) }
89
+ >
90
+ < span className = { classNames ( styles . value , styles . bubble ) } >
91
+ { capture . numJobs }
92
+ </ span >
93
+ </ Link >
94
+ </ div >
72
95
< div >
73
96
< span className = { styles . label } >
74
97
{ translate ( STRING . FIELD_LABEL_DETECTIONS ) }
@@ -79,7 +102,20 @@ export const CaptureDetails = ({
79
102
< span className = { styles . label } >
80
103
{ translate ( STRING . FIELD_LABEL_OCCURRENCES ) }
81
104
</ span >
82
- < span className = { styles . value } > { capture . numOccurrences } </ span >
105
+ < Link
106
+ to = { getAppRoute ( {
107
+ to : APP_ROUTES . OCCURRENCES ( {
108
+ projectId : projectId as string ,
109
+ } ) ,
110
+ filters : {
111
+ detections__source_image : capture . id ,
112
+ } ,
113
+ } ) }
114
+ >
115
+ < span className = { classNames ( styles . value , styles . bubble ) } >
116
+ { capture . numOccurrences }
117
+ </ span >
118
+ </ Link >
83
119
</ div >
84
120
< div >
85
121
< span className = { styles . label } >
0 commit comments