11import {
22 Button ,
3+ ButtonGroup ,
34 Col ,
45 DropdownItem ,
56 DropdownMenu ,
@@ -90,6 +91,15 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
9091 ) ;
9192 const [ excludeExperimental , setExcludeExperimental ] = useState ( false ) ;
9293 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+ } ) ;
93103 const [ selectedPreset , setSelectedPreset ] = useState ( ABC_PRESET ) ;
94104 const problems = useProblems ( ) ?? [ ] ;
95105 const problemModels = useProblemModelMap ( ) ;
@@ -98,6 +108,16 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
98108 const alreadySolvedProblemIds = new Set ( submissions . map ( ( s ) => s . problem_id ) ) ;
99109 const lastSolvedTimeMap = getLastSolvedTimeMap ( submissions ) ;
100110
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+
101121 return (
102122 < Form className = { "w-100" } >
103123 < FormGroup row >
@@ -142,6 +162,31 @@ export const ProblemSetGenerator: React.FC<Props> = (props) => {
142162 </ InputGroup >
143163 </ Col >
144164 </ 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 >
145190 < FormGroup row >
146191 < Col sm = { 6 } >
147192 < Label > Difficulty Adjustment Preset</ Label >
0 commit comments