1
+ import { useTheme } from '@emotion/react' ;
2
+
1
3
import { Badge } from 'sentry/components/core/badge' ;
2
4
import { Flex } from 'sentry/components/core/layout' ;
3
5
import { SegmentedControl } from 'sentry/components/core/segmentedControl' ;
4
6
import { Tooltip } from 'sentry/components/core/tooltip' ;
5
7
import type decodeMailbox from 'sentry/components/feedback/decodeMailbox' ;
6
8
import useMailboxCounts from 'sentry/components/feedback/list/useMailboxCounts' ;
7
9
import { t } from 'sentry/locale' ;
10
+ import { space } from 'sentry/styles/space' ;
8
11
import useOrganization from 'sentry/utils/useOrganization' ;
9
12
10
13
type Mailbox = ReturnType < typeof decodeMailbox > ;
@@ -23,6 +26,7 @@ const MAILBOXES = [
23
26
export default function MailboxPicker ( { onChange, value} : Props ) {
24
27
const organization = useOrganization ( ) ;
25
28
const { data} = useMailboxCounts ( { organization} ) ;
29
+ const theme = useTheme ( ) ;
26
30
27
31
const filteredMailboxes = MAILBOXES ;
28
32
@@ -34,17 +38,17 @@ export default function MailboxPicker({onChange, value}: Props) {
34
38
value = { value }
35
39
onChange = { onChange }
36
40
>
37
- { filteredMailboxes . map ( c => {
41
+ { filteredMailboxes . map ( mailbox => {
38
42
// @ts -expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
39
- const count = data ?. [ c . key ] ;
43
+ const count = data ?. [ mailbox . key ] ;
40
44
const display = count && count >= 100 ? '99+' : count ;
41
45
const title =
42
46
count === 1 ? t ( '1 unassigned item' ) : t ( '%s unassigned items' , display ) ;
43
47
return (
44
- < SegmentedControl . Item key = { c . key } aria-label = { c . label } >
48
+ < SegmentedControl . Item key = { mailbox . key } aria-label = { mailbox . label } >
45
49
< Tooltip disabled = { ! count } title = { title } >
46
- < Flex align = "center" >
47
- { c . label }
50
+ < Flex align = "center" gap = { theme . isChonk ? space ( 0.75 ) : 0 } >
51
+ { mailbox . label }
48
52
{ display ? < Badge type = "default" > { display } </ Badge > : null }
49
53
</ Flex >
50
54
</ Tooltip >
0 commit comments