The product to test.
true when the product has an image, variants, or detail fields.
hasExpandableDetail({ cas: "7647-14-5" } as Product); // => true (detail field)
hasExpandableDetail({ variants: [{}] } as Product); // => true (variants)
hasExpandableDetail({ title: "x", supplier: "y" } as Product); // => false
export function hasExpandableDetail(product: Product): boolean {
if (resolveProductImages(product).length > 0) return true;
if ((product.variants?.length ?? 0) > 0) return true;
// Flattened variant rows (ungrouped mode) always have at least a parent link.
if (product.parentProduct !== undefined) return true;
return EXPANDABLE_DETAIL_KEYS.some((key) => isPresent(product[key]));
}
Reports whether a product has any content worth revealing in the expanded detail panel: a resolvable image, at least one variant, or any populated detail field. Drives both
getRowCanExpandand the expander column so the toggle only appears when expansion would show something.