1
1
import { Fragment } from 'react' ;
2
2
import styled from '@emotion/styled' ;
3
3
4
+ import ActorAvatar from 'sentry/components/avatar/actorAvatar' ;
4
5
import { SectionHeading } from 'sentry/components/charts/styles' ;
5
6
import { KeyValueTable , KeyValueTableRow } from 'sentry/components/keyValueTable' ;
6
7
import Text from 'sentry/components/text' ;
@@ -12,6 +13,7 @@ import {space} from 'sentry/styles/space';
12
13
import { defined } from 'sentry/utils' ;
13
14
import { getFormattedDate } from 'sentry/utils/dates' ;
14
15
import useCopyToClipboard from 'sentry/utils/useCopyToClipboard' ;
16
+ import useOrganization from 'sentry/utils/useOrganization' ;
15
17
import { DEFAULT_MAX_RUNTIME } from 'sentry/views/monitors/components/monitorForm' ;
16
18
import { MonitorIndicator } from 'sentry/views/monitors/components/monitorIndicator' ;
17
19
import type { Monitor , MonitorEnvironment } from 'sentry/views/monitors/types' ;
@@ -24,6 +26,8 @@ interface Props {
24
26
}
25
27
26
28
export default function DetailsSidebar ( { monitorEnv, monitor} : Props ) {
29
+ const org = useOrganization ( ) ;
30
+
27
31
const { checkin_margin, schedule, schedule_type, max_runtime, timezone} = monitor . config ;
28
32
const { onClick, label} = useCopyToClipboard ( { text : monitor . slug } ) ;
29
33
@@ -98,6 +102,18 @@ export default function DetailsSidebar({monitorEnv, monitor}: Props) {
98
102
{ schedule_type === ScheduleType . CRONTAB && (
99
103
< KeyValueTableRow keyName = { t ( 'Timezone' ) } value = { timezone } />
100
104
) }
105
+ { org . features . includes ( 'crons-ownership' ) && (
106
+ < KeyValueTableRow
107
+ keyName = { t ( 'Owner' ) }
108
+ value = {
109
+ monitor . owner ? (
110
+ < ActorAvatar size = { 24 } actor = { monitor . owner } />
111
+ ) : (
112
+ t ( 'Unassigned' )
113
+ )
114
+ }
115
+ />
116
+ ) }
101
117
< KeyValueTableRow
102
118
keyName = { t ( 'Date created' ) }
103
119
value = { getFormattedDate ( monitor . dateCreated , 'MMM D, YYYY' ) }
0 commit comments