mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Dynamic Sizes and Colors
This commit is contained in:
10
components/product/helpers.ts
Normal file
10
components/product/helpers.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Product } from '@lib/bigcommerce/api/operations/get-product'
|
||||
|
||||
export function getProductOptions(product: Product) {
|
||||
const options = product.options.edges?.map(({ node }: any) => ({
|
||||
displayName: node.displayName,
|
||||
values: node.values.edges?.map(({ node }: any) => node),
|
||||
}))
|
||||
|
||||
return options
|
||||
}
|
Reference in New Issue
Block a user