@@ -13,6 +13,7 @@ export default function TeamsTable() {
1313 const [ teams , setTeams ] = useState < Team [ ] > ( [ ] ) ;
1414 const [ search , setSearch ] = useState ( "" ) ;
1515 const [ paymentFilter , setPaymentFilter ] = useState < string > ( "all" ) ;
16+ const [ themeFilter , setThemeFilter ] = useState < string > ( "all" ) ;
1617 const [ page , setPage ] = useState ( 0 ) ;
1718 const [ loading , setLoading ] = useState ( true ) ;
1819 const [ error , setError ] = useState < string | null > ( null ) ;
@@ -156,7 +157,14 @@ export default function TeamsTable() {
156157 setPendingPaymentStatus ( null ) ;
157158 } ;
158159
159- // Filter teams by ID, Title, and Payment Status
160+ // Get unique themes/categories for filter
161+ const uniqueThemes = Array . from ( new Set (
162+ teams
163+ . map ( team => team ?. category )
164+ . filter ( Boolean )
165+ ) ) . sort ( ) ;
166+
167+ // Filter teams by ID, Title, Payment Status, and Theme
160168 const filteredTeams = teams . filter ( ( team ) => {
161169 const matchesSearch = [ team . teamId . toString ( ) , team . title . toLowerCase ( ) ] . some ( ( value ) =>
162170 value . includes ( search . toLowerCase ( ) )
@@ -166,7 +174,10 @@ export default function TeamsTable() {
166174 ( paymentFilter === "verified" && team . paymentVerified ) ||
167175 ( paymentFilter === "pending" && ! team . paymentVerified ) ;
168176
169- return matchesSearch && matchesPayment ;
177+ const matchesTheme = themeFilter === "all" ||
178+ team ?. category === themeFilter ;
179+
180+ return matchesSearch && matchesPayment && matchesTheme ;
170181 } ) ;
171182
172183 // Pagination logic
@@ -198,6 +209,23 @@ export default function TeamsTable() {
198209 focus:outline-none focus:ring-2 focus:ring-orange-500 bg-white dark:bg-black
199210 text-sm sm:text-base text-gray-800 dark:text-gray-100"
200211 />
212+ < select
213+ value = { themeFilter }
214+ onChange = { ( e ) => {
215+ setThemeFilter ( e . target . value ) ;
216+ setPage ( 0 ) ;
217+ } }
218+ className = "px-3 sm:px-4 py-2 border border-orange-300 dark:border-gray-600 rounded-lg shadow-sm
219+ focus:outline-none focus:ring-2 focus:ring-orange-500 bg-white dark:bg-black
220+ text-sm sm:text-base text-gray-800 dark:text-gray-100"
221+ >
222+ < option value = "all" > All Themes</ option >
223+ { uniqueThemes . map ( ( theme ) => (
224+ < option key = { theme } value = { theme } >
225+ { theme }
226+ </ option >
227+ ) ) }
228+ </ select >
201229 < select
202230 value = { paymentFilter }
203231 onChange = { ( e ) => {
@@ -310,7 +338,7 @@ export default function TeamsTable() {
310338 </ div >
311339 < div >
312340 < span className = "font-medium text-gray-600 dark:text-gray-400" > Problem Statement:</ span >
313- < div className = "text-gray-800 dark:text-gray-200 font-medium" > { selectedTeam . problem_statement ?. psId } </ div >
341+ < div className = "text-gray-800 dark:text-gray-200 font-medium" > { selectedTeam ?. category } </ div >
314342 </ div >
315343 </ div >
316344 </ div >
@@ -517,6 +545,7 @@ export default function TeamsTable() {
517545 < th className = "px-4 py-3 text-left" > SCC ID</ th >
518546 < th className = "px-4 py-3 text-left" > Team Name</ th >
519547 < th className = "px-4 py-3 text-left" > Problem Stmt</ th >
548+ < th className = "px-4 py-3 text-left" > Theme</ th >
520549 < th className = "px-4 py-3 text-left" > Member Count</ th >
521550 < th className = "px-4 py-3 text-left" > Payment</ th >
522551 </ tr >
@@ -538,6 +567,11 @@ export default function TeamsTable() {
538567 < td className = "px-4 py-3 text-gray-800 dark:text-gray-100" > { team . scc_id } </ td >
539568 < td className = "px-4 py-3 text-gray-800 dark:text-gray-100" > { team . title } </ td >
540569 < td className = "px-4 py-3 text-gray-800 dark:text-gray-100" > { team . ps_id } </ td >
570+ < td className = "px-4 py-3" >
571+ < span className = "inline-flex items-center px-2 py-1 text-xs font-medium rounded-lg bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300" >
572+ { team ?. category || 'N/A' }
573+ </ span >
574+ </ td >
541575 < td className = "px-4 py-3 text-gray-800 dark:text-gray-100" >
542576 { team . member_count || 0 }
543577 </ td >
@@ -555,7 +589,7 @@ export default function TeamsTable() {
555589 ) : (
556590 < tr >
557591 < td
558- colSpan = { 5 }
592+ colSpan = { 6 }
559593 className = "text-center px-4 py-6 text-gray-500 dark:text-gray-400 italic"
560594 >
561595 No matching teams found
0 commit comments