1
1
import {
2
2
Button ,
3
+ ButtonGroup ,
3
4
Col ,
4
5
DropdownItem ,
5
6
DropdownMenu ,
@@ -90,6 +91,15 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
90
91
) ;
91
92
const [ excludeExperimental , setExcludeExperimental ] = useState ( false ) ;
92
93
const [ excludeOption , setExcludeOption ] = useState < ExcludeOption > ( "Exclude" ) ;
94
+ const [ contestTypeOption , setContestTypeOption ] = useState ( {
95
+ ABC : true ,
96
+ ARC : true ,
97
+ AGC : true ,
98
+ ABC_Like : true ,
99
+ ARC_Like : true ,
100
+ AGC_Like : true ,
101
+ Other_Sponsored : true ,
102
+ } ) ;
93
103
const [ selectedPreset , setSelectedPreset ] = useState ( ABC_PRESET ) ;
94
104
const problems = useProblems ( ) ?? [ ] ;
95
105
const problemModels = useProblemModelMap ( ) ;
@@ -98,6 +108,16 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
98
108
const alreadySolvedProblemIds = new Set ( submissions . map ( ( s ) => s . problem_id ) ) ;
99
109
const lastSolvedTimeMap = getLastSolvedTimeMap ( submissions ) ;
100
110
111
+ const contestTypeKeyToDisplayName = ( key : string ) => {
112
+ if ( key . includes ( "Like" ) ) {
113
+ return key . replace ( "_" , "-" ) ;
114
+ } else if ( key === "Other_Sponsored" ) {
115
+ return "Other Sponsored" ;
116
+ } else {
117
+ return key ;
118
+ }
119
+ } ;
120
+
101
121
return (
102
122
< Form className = { "w-100" } >
103
123
< FormGroup row >
@@ -142,6 +162,31 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
142
162
</ InputGroup >
143
163
</ Col >
144
164
</ FormGroup >
165
+ < FormGroup row >
166
+ < Col sm = { 6 } >
167
+ < Label > Include / Exclude Contest Types</ Label >
168
+ < InputGroup >
169
+ < ButtonGroup >
170
+ { Object . keys ( contestTypeOption ) . map ( ( contestType ) => {
171
+ return (
172
+ < Button
173
+ key = { contestType }
174
+ active = { contestTypeOption [ contestType ] as boolean }
175
+ onClick = { ( ) : void => {
176
+ setContestTypeOption ( {
177
+ ...contestTypeOption ,
178
+ [ contestType ] : ! contestTypeOption [ contestType ] ,
179
+ } ) ;
180
+ } }
181
+ >
182
+ { contestTypeKeyToDisplayName ( contestType ) }
183
+ </ Button >
184
+ ) ;
185
+ } ) }
186
+ </ ButtonGroup >
187
+ </ InputGroup >
188
+ </ Col >
189
+ </ FormGroup >
145
190
< FormGroup row >
146
191
< Col sm = { 6 } >
147
192
< Label > Difficulty Adjustment Preset</ Label >
0 commit comments