refactor: add conditional brand filter counts

This commit is contained in:
Mahen 2026-02-22 06:00:42 +07:00
parent d8bbb35228
commit cac55f1805
2 changed files with 9 additions and 1 deletions

View File

@ -54,7 +54,13 @@ export const getTotalBrandAnalysis = async () => {
brand: true,
_count: {
select: {
reviews: true,
reviews: {
where: {
user: {
email: session.user.email,
},
},
},
},
},
},

View File

@ -30,6 +30,8 @@ export function BrandFilter() {
</button>
{brands.map((brand) => {
if (brand.count === 0) return null;
const isActive =
selectedBrand?.toLowerCase() === brand.name.toLowerCase();