@86d-app/products 0.0.4 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -0
- package/AGENTS.md +41 -41
- package/README.md +266 -5
- package/dist/__tests__/controllers.test.d.ts +2 -0
- package/dist/__tests__/controllers.test.d.ts.map +1 -0
- package/dist/__tests__/endpoint-security.test.d.ts +2 -0
- package/dist/__tests__/endpoint-security.test.d.ts.map +1 -0
- package/dist/__tests__/service-impl.test.d.ts +2 -0
- package/dist/__tests__/service-impl.test.d.ts.map +1 -0
- package/dist/__tests__/state.test.d.ts +2 -0
- package/dist/__tests__/state.test.d.ts.map +1 -0
- package/dist/admin/components/categories-admin.d.ts +2 -0
- package/dist/admin/components/categories-admin.d.ts.map +1 -0
- package/dist/admin/components/category-form.d.ts +7 -0
- package/dist/admin/components/category-form.d.ts.map +1 -0
- package/dist/admin/components/category-list.d.ts +7 -0
- package/dist/admin/components/category-list.d.ts.map +1 -0
- package/dist/admin/components/collections-admin.d.ts +2 -0
- package/dist/admin/components/collections-admin.d.ts.map +1 -0
- package/dist/admin/components/index.d.ts +9 -0
- package/dist/admin/components/index.d.ts.map +1 -0
- package/dist/admin/components/product-detail.d.ts +7 -0
- package/dist/admin/components/product-detail.d.ts.map +1 -0
- package/dist/admin/components/product-edit.d.ts +6 -0
- package/dist/admin/components/product-edit.d.ts.map +1 -0
- package/dist/admin/components/product-form.d.ts +7 -0
- package/dist/admin/components/product-form.d.ts.map +1 -0
- package/dist/admin/components/product-list.d.ts +2 -0
- package/dist/admin/components/product-list.d.ts.map +1 -0
- package/dist/admin/components/product-new.d.ts +2 -0
- package/dist/admin/components/product-new.d.ts.map +1 -0
- package/dist/admin/endpoints/add-collection-product.d.ts +15 -0
- package/dist/admin/endpoints/add-collection-product.d.ts.map +1 -0
- package/dist/admin/endpoints/bulk-action.d.ts +17 -0
- package/dist/admin/endpoints/bulk-action.d.ts.map +1 -0
- package/dist/admin/endpoints/create-category.d.ts +23 -0
- package/dist/admin/endpoints/create-category.d.ts.map +1 -0
- package/dist/admin/endpoints/create-collection.d.ts +22 -0
- package/dist/admin/endpoints/create-collection.d.ts.map +1 -0
- package/dist/admin/endpoints/create-product.d.ts +44 -0
- package/dist/admin/endpoints/create-product.d.ts.map +1 -0
- package/dist/admin/endpoints/create-variant.d.ts +35 -0
- package/dist/admin/endpoints/create-variant.d.ts.map +1 -0
- package/dist/admin/endpoints/delete-category.d.ts +18 -0
- package/dist/admin/endpoints/delete-category.d.ts.map +1 -0
- package/dist/admin/endpoints/delete-collection.d.ts +8 -0
- package/dist/admin/endpoints/delete-collection.d.ts.map +1 -0
- package/dist/admin/endpoints/delete-product.d.ts +18 -0
- package/dist/admin/endpoints/delete-product.d.ts.map +1 -0
- package/dist/admin/endpoints/delete-variant.d.ts +18 -0
- package/dist/admin/endpoints/delete-variant.d.ts.map +1 -0
- package/dist/admin/endpoints/get-product.d.ts +16 -0
- package/dist/admin/endpoints/get-product.d.ts.map +1 -0
- package/dist/admin/endpoints/import-products.d.ts +36 -0
- package/dist/admin/endpoints/import-products.d.ts.map +1 -0
- package/dist/admin/endpoints/index.d.ts +418 -0
- package/dist/admin/endpoints/index.d.ts.map +1 -0
- package/dist/admin/endpoints/list-categories.d.ts +11 -0
- package/dist/admin/endpoints/list-categories.d.ts.map +1 -0
- package/dist/admin/endpoints/list-collections.d.ts +11 -0
- package/dist/admin/endpoints/list-collections.d.ts.map +1 -0
- package/dist/admin/endpoints/list-products.d.ts +27 -0
- package/dist/admin/endpoints/list-products.d.ts.map +1 -0
- package/dist/admin/endpoints/remove-collection-product.d.ts +9 -0
- package/dist/admin/endpoints/remove-collection-product.d.ts.map +1 -0
- package/dist/admin/endpoints/update-category.d.ts +26 -0
- package/dist/admin/endpoints/update-category.d.ts.map +1 -0
- package/dist/admin/endpoints/update-collection.d.ts +19 -0
- package/dist/admin/endpoints/update-collection.d.ts.map +1 -0
- package/dist/admin/endpoints/update-product.d.ts +47 -0
- package/dist/admin/endpoints/update-product.d.ts.map +1 -0
- package/dist/admin/endpoints/update-variant.d.ts +35 -0
- package/dist/admin/endpoints/update-variant.d.ts.map +1 -0
- package/dist/controllers.d.ts +130 -0
- package/dist/controllers.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/markdown.d.ts +6 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/schema.d.ts +351 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/service-impl.d.ts +4 -0
- package/dist/service-impl.d.ts.map +1 -0
- package/dist/service.d.ts +280 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/state.d.ts +38 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/store/components/_hooks.d.ts +88 -0
- package/dist/store/components/_hooks.d.ts.map +1 -0
- package/dist/store/components/_types.d.ts +70 -0
- package/dist/store/components/_types.d.ts.map +1 -0
- package/dist/store/components/_utils.d.ts +5 -0
- package/dist/store/components/_utils.d.ts.map +1 -0
- package/dist/store/components/back-in-stock-notify.d.ts +8 -0
- package/dist/store/components/back-in-stock-notify.d.ts.map +1 -0
- package/dist/store/components/collection-card.d.ts +6 -0
- package/dist/store/components/collection-card.d.ts.map +1 -0
- package/dist/store/components/collection-detail.d.ts +6 -0
- package/dist/store/components/collection-detail.d.ts.map +1 -0
- package/dist/store/components/collection-grid.d.ts +6 -0
- package/dist/store/components/collection-grid.d.ts.map +1 -0
- package/dist/store/components/featured-products.d.ts +6 -0
- package/dist/store/components/featured-products.d.ts.map +1 -0
- package/dist/store/components/filter-chip.d.ts +6 -0
- package/dist/store/components/filter-chip.d.ts.map +1 -0
- package/dist/store/components/index.d.ts +37 -0
- package/dist/store/components/index.d.ts.map +1 -0
- package/dist/store/components/product-card.d.ts +7 -0
- package/dist/store/components/product-card.d.ts.map +1 -0
- package/dist/store/components/product-detail.d.ts +6 -0
- package/dist/store/components/product-detail.d.ts.map +1 -0
- package/dist/store/components/product-listing.d.ts +7 -0
- package/dist/store/components/product-listing.d.ts.map +1 -0
- package/dist/store/components/product-qa-section.d.ts +5 -0
- package/dist/store/components/product-qa-section.d.ts.map +1 -0
- package/dist/store/components/product-reviews-section.d.ts +5 -0
- package/dist/store/components/product-reviews-section.d.ts.map +1 -0
- package/dist/store/components/recently-viewed.d.ts +12 -0
- package/dist/store/components/recently-viewed.d.ts.map +1 -0
- package/dist/store/components/recommended-products.d.ts +7 -0
- package/dist/store/components/recommended-products.d.ts.map +1 -0
- package/dist/store/components/related-products.d.ts +7 -0
- package/dist/store/components/related-products.d.ts.map +1 -0
- package/dist/store/components/star-display.d.ts +6 -0
- package/dist/store/components/star-display.d.ts.map +1 -0
- package/dist/store/components/star-picker.d.ts +6 -0
- package/dist/store/components/star-picker.d.ts.map +1 -0
- package/dist/store/components/stock-badge.d.ts +5 -0
- package/dist/store/components/stock-badge.d.ts.map +1 -0
- package/dist/store/endpoints/get-category.d.ts +22 -0
- package/dist/store/endpoints/get-category.d.ts.map +1 -0
- package/dist/store/endpoints/get-collection.d.ts +17 -0
- package/dist/store/endpoints/get-collection.d.ts.map +1 -0
- package/dist/store/endpoints/get-featured.d.ts +10 -0
- package/dist/store/endpoints/get-featured.d.ts.map +1 -0
- package/dist/store/endpoints/get-product.d.ts +17 -0
- package/dist/store/endpoints/get-product.d.ts.map +1 -0
- package/dist/store/endpoints/get-related.d.ts +11 -0
- package/dist/store/endpoints/get-related.d.ts.map +1 -0
- package/dist/store/endpoints/index.d.ts +129 -0
- package/dist/store/endpoints/index.d.ts.map +1 -0
- package/dist/store/endpoints/list-categories.d.ts +6 -0
- package/dist/store/endpoints/list-categories.d.ts.map +1 -0
- package/dist/store/endpoints/list-collections.d.ts +10 -0
- package/dist/store/endpoints/list-collections.d.ts.map +1 -0
- package/dist/store/endpoints/list-products.d.ts +26 -0
- package/dist/store/endpoints/list-products.d.ts.map +1 -0
- package/dist/store/endpoints/search-products.d.ts +11 -0
- package/dist/store/endpoints/search-products.d.ts.map +1 -0
- package/dist/store/endpoints/store-search.d.ts +18 -0
- package/dist/store/endpoints/store-search.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/__tests__/endpoint-security.test.ts +457 -0
- package/src/__tests__/service-impl.test.ts +1745 -0
- package/src/admin/endpoints/create-category.ts +5 -2
- package/src/admin/endpoints/create-collection.ts +1 -1
- package/src/admin/endpoints/create-product.ts +5 -2
- package/src/admin/endpoints/delete-category.ts +1 -1
- package/src/admin/endpoints/delete-collection.ts +1 -1
- package/src/admin/endpoints/delete-product.ts +1 -1
- package/src/admin/endpoints/delete-variant.ts +1 -1
- package/src/admin/endpoints/list-categories.ts +1 -1
- package/src/admin/endpoints/list-collections.ts +1 -1
- package/src/admin/endpoints/list-products.ts +1 -1
- package/src/admin/endpoints/remove-collection-product.ts +1 -1
- package/src/admin/endpoints/update-category.ts +5 -2
- package/src/admin/endpoints/update-collection.ts +1 -1
- package/src/admin/endpoints/update-product.ts +5 -2
- package/src/admin/endpoints/update-variant.ts +1 -1
- package/src/service-impl.ts +1139 -0
- package/src/service.ts +312 -0
- package/src/store/components/_hooks.ts +81 -0
- package/src/store/components/_utils.ts +8 -0
- package/src/store/components/collection-detail.tsx +21 -1
- package/src/store/components/collection-grid.tsx +5 -1
- package/src/store/components/featured-products.tsx +5 -1
- package/src/store/components/index.tsx +2 -0
- package/src/store/components/product-card.mdx +1 -1
- package/src/store/components/product-card.tsx +25 -5
- package/src/store/components/product-detail.mdx +2 -0
- package/src/store/components/product-detail.tsx +55 -8
- package/src/store/components/product-listing.tsx +25 -4
- package/src/store/components/product-qa-section.mdx +21 -0
- package/src/store/components/product-qa-section.tsx +503 -0
- package/src/store/components/recommended-products.mdx +6 -0
- package/src/store/components/recommended-products.tsx +119 -0
- package/src/store/endpoints/get-category.ts +2 -2
- package/src/store/endpoints/get-collection.ts +1 -1
- package/src/store/endpoints/get-featured.ts +1 -1
- package/src/store/endpoints/get-product.ts +1 -1
- package/src/store/endpoints/get-related.ts +2 -2
- package/src/store/endpoints/list-collections.ts +3 -3
- package/src/store/endpoints/list-products.ts +9 -9
- package/src/store/endpoints/search-products.ts +4 -6
- package/src/store/endpoints/store-search.ts +1 -1
- package/COMPONENTS.md +0 -231
|
@@ -6,17 +6,17 @@ export const listProducts = createStoreEndpoint(
|
|
|
6
6
|
method: "GET",
|
|
7
7
|
query: z
|
|
8
8
|
.object({
|
|
9
|
-
page: z.string().optional(),
|
|
10
|
-
limit: z.string().optional(),
|
|
11
|
-
category: z.string().optional(),
|
|
12
|
-
featured: z.string().optional(),
|
|
13
|
-
search: z.string().optional(),
|
|
9
|
+
page: z.string().max(10).optional(),
|
|
10
|
+
limit: z.string().max(10).optional(),
|
|
11
|
+
category: z.string().max(200).optional(),
|
|
12
|
+
featured: z.string().max(10).optional(),
|
|
13
|
+
search: z.string().max(500).optional(),
|
|
14
14
|
sort: z.enum(["name", "price", "createdAt", "updatedAt"]).optional(),
|
|
15
15
|
order: z.enum(["asc", "desc"]).optional(),
|
|
16
|
-
minPrice: z.string().optional(),
|
|
17
|
-
maxPrice: z.string().optional(),
|
|
18
|
-
inStock: z.string().optional(),
|
|
19
|
-
tag: z.string().optional(),
|
|
16
|
+
minPrice: z.string().max(20).optional(),
|
|
17
|
+
maxPrice: z.string().max(20).optional(),
|
|
18
|
+
inStock: z.string().max(10).optional(),
|
|
19
|
+
tag: z.string().max(200).optional(),
|
|
20
20
|
})
|
|
21
21
|
.optional(),
|
|
22
22
|
},
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { createStoreEndpoint, z } from "@86d-app/core";
|
|
1
|
+
import { createStoreEndpoint, sanitizeText, z } from "@86d-app/core";
|
|
2
2
|
|
|
3
3
|
export const searchProducts = createStoreEndpoint(
|
|
4
4
|
"/products/search",
|
|
5
5
|
{
|
|
6
6
|
method: "GET",
|
|
7
7
|
query: z.object({
|
|
8
|
-
q: z.string().min(1).max(500),
|
|
9
|
-
limit: z.string().optional(),
|
|
8
|
+
q: z.string().min(1).max(500).transform(sanitizeText),
|
|
9
|
+
limit: z.string().max(10).optional(),
|
|
10
10
|
}),
|
|
11
11
|
},
|
|
12
12
|
async (ctx) => {
|
|
13
|
-
const { query } = ctx;
|
|
14
|
-
// Call the controller directly
|
|
15
13
|
const products = await ctx.context.controllers.product.search(ctx);
|
|
16
|
-
return { products
|
|
14
|
+
return { products };
|
|
17
15
|
},
|
|
18
16
|
);
|
package/COMPONENTS.md
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
# Products Module — Store Components
|
|
2
|
-
|
|
3
|
-
Components exported for use in store MDX templates. Import via the component registry (auto-registered when the module is in `templates/brisa/config.json`).
|
|
4
|
-
|
|
5
|
-
## ProductCard
|
|
6
|
-
|
|
7
|
-
Displays a single product card with image, name, price, discount badge, and optional "Add to Cart" button.
|
|
8
|
-
|
|
9
|
-
### Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Description |
|
|
12
|
-
|------|------|---------|-------------|
|
|
13
|
-
| `product` | `Product` | — | Product object with id, name, slug, price, images, etc. |
|
|
14
|
-
| `showAddToCart` | `boolean` | `true` | Show the "Add to Cart" button |
|
|
15
|
-
|
|
16
|
-
### Usage in MDX
|
|
17
|
-
|
|
18
|
-
```mdx
|
|
19
|
-
<ProductCard product={product} />
|
|
20
|
-
|
|
21
|
-
<ProductCard product={product} showAddToCart={false} />
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## FeaturedProducts
|
|
25
|
-
|
|
26
|
-
Displays a responsive grid of featured products. Fetches its own data.
|
|
27
|
-
|
|
28
|
-
### Props
|
|
29
|
-
|
|
30
|
-
| Prop | Type | Default | Description |
|
|
31
|
-
|------|------|---------|-------------|
|
|
32
|
-
| `limit` | `number` | — | Max number of featured products to display |
|
|
33
|
-
| `title` | `string` | — | Section heading |
|
|
34
|
-
|
|
35
|
-
### Usage in MDX
|
|
36
|
-
|
|
37
|
-
```mdx
|
|
38
|
-
<FeaturedProducts />
|
|
39
|
-
|
|
40
|
-
<FeaturedProducts limit={4} title="Staff Picks" />
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## ProductListing
|
|
44
|
-
|
|
45
|
-
Full product listing with search, category/price/stock/tag filters, sorting, and pagination. Fetches its own data.
|
|
46
|
-
|
|
47
|
-
### Props
|
|
48
|
-
|
|
49
|
-
| Prop | Type | Default | Description |
|
|
50
|
-
|------|------|---------|-------------|
|
|
51
|
-
| `initialCategory` | `string` | — | Pre-select a category filter |
|
|
52
|
-
| `initialSearch` | `string` | — | Pre-fill the search query |
|
|
53
|
-
| `pageSize` | `number` | — | Products per page |
|
|
54
|
-
|
|
55
|
-
### Usage in MDX
|
|
56
|
-
|
|
57
|
-
```mdx
|
|
58
|
-
<ProductListing />
|
|
59
|
-
|
|
60
|
-
<ProductListing initialCategory="shoes" pageSize={12} />
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## ProductDetail
|
|
64
|
-
|
|
65
|
-
Full product detail page with image gallery, variant selector, pricing, inventory status, reviews, and related products. Fetches its own data.
|
|
66
|
-
|
|
67
|
-
### Props
|
|
68
|
-
|
|
69
|
-
| Prop | Type | Description |
|
|
70
|
-
|------|------|-------------|
|
|
71
|
-
| `slug` | `string` | Product slug (from URL) |
|
|
72
|
-
| `params` | `Record<string, string>` | Route params (params.slug) |
|
|
73
|
-
|
|
74
|
-
### Usage
|
|
75
|
-
|
|
76
|
-
Loaded dynamically by the store catch-all route for `/products/:slug`.
|
|
77
|
-
|
|
78
|
-
## RelatedProducts
|
|
79
|
-
|
|
80
|
-
Horizontal grid of related products for a given product. Fetches its own data.
|
|
81
|
-
|
|
82
|
-
### Props
|
|
83
|
-
|
|
84
|
-
| Prop | Type | Default | Description |
|
|
85
|
-
|------|------|---------|-------------|
|
|
86
|
-
| `productId` | `string` | — | Product ID to find related products for |
|
|
87
|
-
| `limit` | `number` | — | Max related products to show |
|
|
88
|
-
| `title` | `string` | — | Section heading |
|
|
89
|
-
|
|
90
|
-
### Usage in MDX
|
|
91
|
-
|
|
92
|
-
```mdx
|
|
93
|
-
<RelatedProducts productId={product.id} />
|
|
94
|
-
|
|
95
|
-
<RelatedProducts productId={product.id} limit={4} title="You may also like" />
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## CollectionCard
|
|
99
|
-
|
|
100
|
-
Displays a single collection card with image, name, and description.
|
|
101
|
-
|
|
102
|
-
### Props
|
|
103
|
-
|
|
104
|
-
| Prop | Type | Description |
|
|
105
|
-
|------|------|-------------|
|
|
106
|
-
| `collection` | `CollectionCardData` | Collection object with id, name, slug, description, image |
|
|
107
|
-
|
|
108
|
-
### Usage in MDX
|
|
109
|
-
|
|
110
|
-
```mdx
|
|
111
|
-
<CollectionCard collection={collection} />
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## CollectionGrid
|
|
115
|
-
|
|
116
|
-
Grid of collections with optional featured-only filtering. Fetches its own data.
|
|
117
|
-
|
|
118
|
-
### Props
|
|
119
|
-
|
|
120
|
-
| Prop | Type | Default | Description |
|
|
121
|
-
|------|------|---------|-------------|
|
|
122
|
-
| `title` | `string` | — | Section heading |
|
|
123
|
-
| `featured` | `boolean` | — | Only show featured collections |
|
|
124
|
-
|
|
125
|
-
### Usage in MDX
|
|
126
|
-
|
|
127
|
-
```mdx
|
|
128
|
-
<CollectionGrid />
|
|
129
|
-
|
|
130
|
-
<CollectionGrid title="Shop by Category" featured={true} />
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## CollectionDetail
|
|
134
|
-
|
|
135
|
-
Full collection page with image, description, product count, and products grid. Fetches its own data.
|
|
136
|
-
|
|
137
|
-
### Props
|
|
138
|
-
|
|
139
|
-
| Prop | Type | Description |
|
|
140
|
-
|------|------|-------------|
|
|
141
|
-
| `slug` | `string` | Collection slug (from URL) |
|
|
142
|
-
| `params` | `Record<string, string>` | Route params (params.slug) |
|
|
143
|
-
|
|
144
|
-
### Usage
|
|
145
|
-
|
|
146
|
-
Loaded dynamically by the store catch-all route for `/collections/:slug`.
|
|
147
|
-
|
|
148
|
-
## FilterChip
|
|
149
|
-
|
|
150
|
-
Small removable tag displaying an active filter. Used internally by ProductListing.
|
|
151
|
-
|
|
152
|
-
### Props
|
|
153
|
-
|
|
154
|
-
| Prop | Type | Description |
|
|
155
|
-
|------|------|-------------|
|
|
156
|
-
| `label` | `string` | Filter display text |
|
|
157
|
-
| `onRemove` | `() => void` | Callback when the chip is dismissed |
|
|
158
|
-
|
|
159
|
-
### Usage in MDX
|
|
160
|
-
|
|
161
|
-
```mdx
|
|
162
|
-
<FilterChip label="Shoes" onRemove={handleRemove} />
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## StarDisplay
|
|
166
|
-
|
|
167
|
-
Read-only star rating display.
|
|
168
|
-
|
|
169
|
-
### Props
|
|
170
|
-
|
|
171
|
-
| Prop | Type | Default | Description |
|
|
172
|
-
|------|------|---------|-------------|
|
|
173
|
-
| `rating` | `number` | — | Rating value (0–5) |
|
|
174
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Star size |
|
|
175
|
-
|
|
176
|
-
### Usage in MDX
|
|
177
|
-
|
|
178
|
-
```mdx
|
|
179
|
-
<StarDisplay rating={4.5} />
|
|
180
|
-
|
|
181
|
-
<StarDisplay rating={product.averageRating} size="sm" />
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## StarPicker
|
|
185
|
-
|
|
186
|
-
Interactive star rating input for review submission.
|
|
187
|
-
|
|
188
|
-
### Props
|
|
189
|
-
|
|
190
|
-
| Prop | Type | Description |
|
|
191
|
-
|------|------|-------------|
|
|
192
|
-
| `value` | `number` | Current rating value |
|
|
193
|
-
| `onChange` | `(n: number) => void` | Callback when user selects a rating |
|
|
194
|
-
|
|
195
|
-
### Usage in MDX
|
|
196
|
-
|
|
197
|
-
```mdx
|
|
198
|
-
<StarPicker value={rating} onChange={setRating} />
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
## StockBadge
|
|
202
|
-
|
|
203
|
-
Inventory status badge. Shows "Out of stock", "Only X left", or "In stock".
|
|
204
|
-
|
|
205
|
-
### Props
|
|
206
|
-
|
|
207
|
-
| Prop | Type | Description |
|
|
208
|
-
|------|------|-------------|
|
|
209
|
-
| `inventory` | `number` | Available inventory count |
|
|
210
|
-
|
|
211
|
-
### Usage in MDX
|
|
212
|
-
|
|
213
|
-
```mdx
|
|
214
|
-
<StockBadge inventory={product.inventory} />
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## ProductReviewsSection
|
|
218
|
-
|
|
219
|
-
Complete review section with rating summary, review list with pagination, and review submission form. Fetches its own data.
|
|
220
|
-
|
|
221
|
-
### Props
|
|
222
|
-
|
|
223
|
-
| Prop | Type | Description |
|
|
224
|
-
|------|------|-------------|
|
|
225
|
-
| `productId` | `string` | Product ID to show reviews for |
|
|
226
|
-
|
|
227
|
-
### Usage in MDX
|
|
228
|
-
|
|
229
|
-
```mdx
|
|
230
|
-
<ProductReviewsSection productId={product.id} />
|
|
231
|
-
```
|