Skip to content

Commit feebc1e

Browse files
committed
Fix: Disable product selection during content generation
1 parent 4448b22 commit feebc1e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

content-gen/src/app/frontend/src/components/ChatPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export function ChatPanel({
149149
onStartOver={onProductsStartOver || (() => {})}
150150
isAwaitingResponse={isLoading}
151151
onProductSelect={onProductSelect}
152+
disabled={isLoading}
152153
/>
153154
)}
154155

content-gen/src/app/frontend/src/components/ProductReview.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface ProductReviewProps {
1616
isAwaitingResponse?: boolean;
1717
availableProducts?: Product[];
1818
onProductSelect?: (product: Product) => void;
19+
disabled?: boolean;
1920
}
2021

2122
export function ProductReview({
@@ -25,6 +26,7 @@ export function ProductReview({
2526
isAwaitingResponse = false,
2627
availableProducts = [],
2728
onProductSelect,
29+
disabled = false,
2830
}: ProductReviewProps) {
2931
const displayProducts = availableProducts.length > 0 ? availableProducts : products;
3032
const selectedProductIds = new Set(products.map(p => p.sku || p.product_name));
@@ -69,6 +71,7 @@ export function ProductReview({
6971
product={product}
7072
isSelected={isProductSelected(product)}
7173
onClick={() => handleProductClick(product)}
74+
disabled={disabled}
7275
/>
7376
))}
7477
</div>
@@ -129,13 +132,14 @@ interface ProductCardGridProps {
129132
product: Product;
130133
isSelected: boolean;
131134
onClick: () => void;
135+
disabled?: boolean;
132136
}
133137

134-
function ProductCardGrid({ product, isSelected, onClick }: ProductCardGridProps) {
138+
function ProductCardGrid({ product, isSelected, onClick, disabled = false }: ProductCardGridProps) {
135139
return (
136140
<div
137-
className={`product-card ${isSelected ? 'selected' : ''}`}
138-
onClick={onClick}
141+
className={`product-card ${isSelected ? 'selected' : ''} ${disabled ? 'disabled' : ''}`}
142+
onClick={disabled ? undefined : onClick}
139143
style={{
140144
display: 'flex',
141145
flexDirection: 'row',
@@ -145,8 +149,10 @@ function ProductCardGrid({ product, isSelected, onClick }: ProductCardGridProps)
145149
borderRadius: '8px',
146150
border: isSelected ? `2px solid ${tokens.colorBrandStroke1}` : `1px dashed ${tokens.colorNeutralStroke2}`,
147151
backgroundColor: isSelected ? tokens.colorBrandBackground2 : tokens.colorNeutralBackground1,
148-
cursor: 'pointer',
152+
cursor: disabled ? 'not-allowed' : 'pointer',
153+
opacity: disabled ? 0.6 : 1,
149154
transition: 'all 0.15s ease-in-out',
155+
pointerEvents: disabled ? 'none' : 'auto',
150156
}}
151157
>
152158
{product.image_url ? (

0 commit comments

Comments
 (0)