File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ export default function PostFilters({
6565 onSortChange ( 'recent' ) ;
6666 } ;
6767
68+ const hasActiveFilters = selectedTags . length > 0 || searchTerm . length > 0 || sortBy !== 'recent' ;
69+
6870 return (
6971 < div >
7072 { /* Search Bar */ }
@@ -195,6 +197,23 @@ export default function PostFilters({
195197 ) }
196198 </ div >
197199 ) }
200+
201+ { /* Clear All Filters Button */ }
202+ { hasActiveFilters && (
203+ < div className = "pt-4 mt-4" style = { { borderTop : `1px solid ${ colours . card . border } ` } } >
204+ < button
205+ onClick = { clearAllFilters }
206+ className = "w-full px-4 py-2 text-sm font-medium rounded-lg transition-colors"
207+ style = { {
208+ backgroundColor : colours . status . error . background ,
209+ color : colours . status . error . border ,
210+ border : `2px solid ${ colours . status . error . border } `
211+ } }
212+ >
213+ Clear All Filters
214+ </ button >
215+ </ div >
216+ ) }
198217 </ div >
199218 ) }
200219 </ div >
You can’t perform that action at this time.
0 commit comments