@@ -2,8 +2,7 @@ import styled from '@emotion/styled';
2
2
3
3
import { DATA_CATEGORY_INFO } from 'sentry/constants' ;
4
4
import { IconArrow } from 'sentry/icons' ;
5
- import { t , tct } from 'sentry/locale' ;
6
- import { space } from 'sentry/styles/space' ;
5
+ import { tct } from 'sentry/locale' ;
7
6
import type { DataCategory } from 'sentry/types/core' ;
8
7
import { DataCategoryExact } from 'sentry/types/core' ;
9
8
@@ -17,6 +16,8 @@ type DataRow = {
17
16
nextValue : number | null ;
18
17
type : DataCategoryExact ;
19
18
hasCredits ?: boolean ;
19
+ previousType ?: DataCategoryExact ;
20
+ titleOverride ?: string ;
20
21
} ;
21
22
22
23
type PriceRow = {
@@ -100,34 +101,6 @@ function PlanMigrationRow(props: Props) {
100
101
currentValue = props . currentValue ;
101
102
nextValue = props . nextValue ;
102
103
break ;
103
- case DataCategoryExact . ERROR :
104
- currentValue = formatCategoryRowString ( props . type , props . currentValue , options ) ;
105
- // eslint-disable-next-line no-case-declarations
106
- const formattedErrors = formatCategoryRowString (
107
- props . type ,
108
- props . nextValue ,
109
- options
110
- ) ;
111
- nextValue = props . hasCredits ? `${ formattedErrors } *` : formattedErrors ;
112
- break ;
113
- case DataCategoryExact . TRANSACTION :
114
- case DataCategoryExact . REPLAY :
115
- case DataCategoryExact . MONITOR_SEAT :
116
- case DataCategoryExact . ATTACHMENT :
117
- case DataCategoryExact . LOG_BYTE :
118
- case DataCategoryExact . PROFILE_DURATION :
119
- currentValue = formatCategoryRowString ( props . type , props . currentValue , options ) ;
120
- nextValue = formatCategoryRowString ( props . type , props . nextValue , options ) ;
121
- break ;
122
- case DataCategoryExact . SPAN :
123
- currentValue = formatCategoryRowString (
124
- DataCategoryExact . TRANSACTION ,
125
- props . currentValue ,
126
- options
127
- ) ;
128
- nextValue = formatCategoryRowString ( props . type , props . nextValue , options ) ;
129
- currentTitle = t ( 'Tracing and Performance Monitoring' ) ;
130
- break ;
131
104
case 'price' :
132
105
currentValue = displayPrice ( { cents : props . currentValue } ) ;
133
106
discountPrice = displayPrice ( { cents : props . discountPrice } ) ;
@@ -139,8 +112,24 @@ function PlanMigrationRow(props: Props) {
139
112
nextValue = displayPrice ( { cents : props . nextValue } ) ;
140
113
currentTitle = 'renewal price' ;
141
114
break ;
142
- default :
143
- return null ;
115
+ default : {
116
+ // assume DataCategoryExact
117
+ currentValue = formatCategoryRowString (
118
+ props . previousType ?? props . type ,
119
+ props . currentValue ,
120
+ options
121
+ ) ;
122
+ const formattedNextValue = formatCategoryRowString (
123
+ props . type ,
124
+ props . nextValue ,
125
+ options
126
+ ) ;
127
+ nextValue = props . hasCredits ? `${ formattedNextValue } *` : formattedNextValue ;
128
+ if ( props . titleOverride ) {
129
+ currentTitle = props . titleOverride ;
130
+ }
131
+ break ;
132
+ }
144
133
}
145
134
146
135
const hasDiscount =
@@ -171,7 +160,7 @@ const Title = styled('td')`
171
160
172
161
const DiscountCell = styled ( 'td' ) `
173
162
display: flex;
174
- gap: ${ space ( 1 ) } ;
163
+ gap: ${ p => p . theme . space . md } ;
175
164
justify-content: flex-end;
176
165
` ;
177
166
0 commit comments