fix: add active filters count to context and components

- Integrated activeFiltersCount into useTasksContext for HomePageContent and KanbanFilters.
- Removed redundant activeFiltersCount calculation from KanbanFilters, leveraging the context instead for better performance and consistency.
This commit is contained in:
Julien Froidefond
2025-09-17 14:46:27 +02:00
parent 8394f78fc7
commit b0dc1bec11
3 changed files with 17 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ interface HomePageClientProps {
function HomePageContent() {
const { stats, syncing, createTask } = useTasksContext();
const { stats, syncing, createTask, activeFiltersCount } = useTasksContext();
const { preferences, updateViewPreferences } = useUserPreferences();
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
@@ -78,7 +78,7 @@ function HomePageContent() {
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4" />
</svg>
Filtres
Filtres{activeFiltersCount > 0 && ` (${activeFiltersCount})`}
</button>
<button