@@ -7,6 +7,7 @@ import styles from './HighlightGenerator.m.less';
7
7
import { formatSecondsToHMS } from './ClipPreview' ;
8
8
import { $t } from 'services/i18n' ;
9
9
import { EHighlighterInputTypes , IInput } from 'services/highlighter/models/ai-highlighter.models' ;
10
+ import Translate from 'components-react/shared/Translate' ;
10
11
const { Option } = Select ;
11
12
12
13
const selectStyles = {
@@ -107,68 +108,90 @@ export default function HighlightGenerator({
107
108
}
108
109
109
110
return (
110
- < div className = { styles . wrapper } >
111
- < h3 style = { { color : '#FFFFFF' , margin : 0 , fontWeight : 400 } } >
112
- 🤖 { $t ( 'Create highlight video of' ) }
113
- </ h3 >
114
- < Select
115
- style = { selectStyles }
116
- mode = "multiple"
117
- value = { selectedRounds }
118
- maxTagCount = { 2 }
119
- suffixIcon = { < DownOutlined style = { { color : '#FFFFFF' , fontSize : '12px' } } /> }
120
- tagRender = { ( { value } ) => (
121
- < span className = { styles . tag } > { value === 0 ? 'All Rounds' : `Round ${ value } ` } </ span >
111
+ < h3
112
+ className = { styles . wrapper }
113
+ style = { {
114
+ color : '#FFFFFF' ,
115
+ margin : 0 ,
116
+ fontWeight : 400 ,
117
+ } }
118
+ >
119
+ 🤖 { ' ' }
120
+ < Translate
121
+ message = { $t (
122
+ 'Create highlight video of <roundSelect></roundSelect> with a duration of <minutesSelect></minutesSelect>' ,
122
123
) }
123
- dropdownStyle = { dropdownStyles }
124
- >
125
- < div key = "all-rounds" className = { styles . option } >
126
- < Checkbox
127
- style = { checkboxStyles }
128
- checked = { selectedRounds . includes ( 0 ) }
129
- onChange = { e => {
130
- setSelectedRounds ( e . target . checked ? [ 0 ] : [ ] ) ;
131
- } }
132
- >
133
- { $t ( 'All rounds' ) }
134
- </ Checkbox >
135
- </ div >
136
- { roundDetails . map ( roundDetails => (
137
- < div key = { 'in-wrapper-round' + roundDetails . round } className = { styles . option } >
138
- < Checkbox
139
- style = { checkboxStyles }
140
- checked = { selectedRounds . includes ( roundDetails . round ) }
141
- onChange = { e => {
142
- if ( e . target . checked ) {
143
- const newSelection = [ ...selectedRounds . filter ( r => r !== 0 ) , roundDetails . round ] ;
144
- setSelectedRounds ( newSelection ) ;
145
- } else {
146
- const newSelection = selectedRounds . filter ( r => r !== roundDetails . round ) ;
147
- setSelectedRounds ( newSelection . length === 0 ? [ 0 ] : newSelection ) ;
148
- }
149
- } }
124
+ renderSlots = { {
125
+ roundSelect : ( ) => (
126
+ < Select
127
+ style = { selectStyles }
128
+ mode = "multiple"
129
+ value = { selectedRounds }
130
+ maxTagCount = { 2 }
131
+ suffixIcon = { < DownOutlined style = { { color : '#FFFFFF' , fontSize : '12px' } } /> }
132
+ tagRender = { ( { value } ) => (
133
+ < span className = { styles . tag } >
134
+ { value === 0
135
+ ? $t ( 'All Rounds' )
136
+ : $t ( 'Round %{roundNumber}' , { roundNumber : value } ) }
137
+ </ span >
138
+ ) }
139
+ dropdownStyle = { dropdownStyles }
140
+ >
141
+ < div key = "all-rounds" className = { styles . option } >
142
+ < Checkbox
143
+ style = { checkboxStyles }
144
+ checked = { selectedRounds . includes ( 0 ) }
145
+ onChange = { e => {
146
+ setSelectedRounds ( e . target . checked ? [ 0 ] : [ ] ) ;
147
+ } }
148
+ >
149
+ { $t ( 'All Rounds' ) }
150
+ </ Checkbox >
151
+ </ div >
152
+ { roundDetails . map ( roundDetails => (
153
+ < div key = { 'in-wrapper-round' + roundDetails . round } className = { styles . option } >
154
+ < Checkbox
155
+ style = { checkboxStyles }
156
+ checked = { selectedRounds . includes ( roundDetails . round ) }
157
+ onChange = { e => {
158
+ if ( e . target . checked ) {
159
+ const newSelection = [
160
+ ...selectedRounds . filter ( r => r !== 0 ) ,
161
+ roundDetails . round ,
162
+ ] ;
163
+ setSelectedRounds ( newSelection ) ;
164
+ } else {
165
+ const newSelection = selectedRounds . filter ( r => r !== roundDetails . round ) ;
166
+ setSelectedRounds ( newSelection . length === 0 ? [ 0 ] : newSelection ) ;
167
+ }
168
+ } }
169
+ >
170
+ { roundDropdownDetails ( roundDetails ) }
171
+ </ Checkbox >
172
+ </ div >
173
+ ) ) }
174
+ </ Select >
175
+ ) ,
176
+ minutesSelect : ( ) => (
177
+ < Select
178
+ style = { { width : '116px' } }
179
+ value = { targetDuration }
180
+ onChange = { value => setTargetDuration ( value ) }
181
+ dropdownStyle = { dropdownStyles }
150
182
>
151
- { roundDropdownDetails ( roundDetails ) }
152
- </ Checkbox >
153
- </ div >
154
- ) ) }
155
- </ Select >
156
- < h3 style = { { color : '#FFFFFF' , margin : 0 , fontWeight : 400 } } > { $t ( 'with a duration of' ) } </ h3 >
157
- < Select
158
- style = { { width : '116px' } }
159
- value = { targetDuration }
160
- onChange = { value => setTargetDuration ( value ) }
161
- dropdownStyle = { dropdownStyles }
162
- >
163
- { filteredOptions . map ( option => (
164
- < Option key = { option . value } value = { option . value } className = { styles . option } >
165
- { option . label }
166
- </ Option >
167
- ) ) }
168
- < Option value = { combinedClipsDuration + 100 } className = { styles . option } >
169
- { $t ( 'unlimited' ) }
170
- </ Option >
171
- </ Select >
183
+ { filteredOptions . map ( option => (
184
+ < Option key = { option . value } value = { option . value } className = { styles . option } >
185
+ { option . label }
186
+ </ Option >
187
+ ) ) }
188
+ < Option value = { combinedClipsDuration + 100 } className = { styles . option } >
189
+ { $t ( 'unlimited' ) }
190
+ </ Option >
191
+ </ Select >
192
+ ) ,
193
+ } }
194
+ > </ Translate >
172
195
< Button
173
196
type = "text"
174
197
onClick = { ( ) => {
@@ -179,6 +202,6 @@ export default function HighlightGenerator({
179
202
icon = { < span style = { { color : '#666666' , fontSize : '20px' } } > ×</ span > }
180
203
className = { styles . resetButton }
181
204
/>
182
- </ div >
205
+ </ h3 >
183
206
) ;
184
207
}
0 commit comments