Skip to content

Conversation

@katPanek
Copy link
Contributor

No description provided.

@katPanek katPanek requested a review from mikolvj October 21, 2025 09:02
@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mercurvendor-testing Ready Ready Preview Comment Oct 28, 2025 9:34am
vendor-panel Ready Ready Preview Comment Oct 28, 2025 9:34am
vendor-plugin-test Ready Ready Preview Comment Oct 28, 2025 9:34am
vendor-sandbox Ready Ready Preview Comment Oct 28, 2025 9:34am

/>
))}
{attribute_values
.filter((attribute) => attribute != null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about .filter(Boolean) ?

<SectionRow
title={t("products.fields.primaryCategory.label")}
value={
product.categories?.length
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest checking length this way
!!product.categories?.length to exclude empty arrays

<SectionRow
title={t("products.fields.secondaryCategories.label")}
value={
product.secondary_categories?.length
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest checking length this way
!!product.categories?.length to exclude empty arrays

mikolvj
mikolvj previously approved these changes Oct 21, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo it'll better fit if you use kebab-case here

Comment on lines 17 to 31
const { attribute_values } = product

const { attributes, isLoading } = useProductAttributes(product.id)

const attributeList = useMemo(() => {
return attributes?.map((attribute) => {
const value =
product.attribute_values?.filter(Boolean).find((av) => av.attribute_id === attribute.id)
?.value || "-"
return {
...attribute,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. useMemo seems unnecessary and maybe a little bit risky here, so i suggest to not use it
  2. do we need this .filter(Boolean) here actually? how about just optional chaining

<SectionRow
key={attribute.id}
title={attribute.attribute.name}
value={attribute.value}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're getting attributes from BE is there a chance to get empty value? so do we need this bool filter actually?

@WojciechPlodzien
Copy link
Collaborator

@mikolvj @kacpergumieniuk
need to solve conflict

@WojciechPlodzien
Copy link
Collaborator

@mikolvj @kacpergumieniuk conflict

@kacpergumieniuk kacpergumieniuk changed the base branch from test to development December 11, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants