Files
Rami BitarandClaude Opus 5 69ca137c7d Rename block .editor files to .config
Also drop the color and leftSideBarVisible overrides from PageEditor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014xjLo7mFxZXfPDCHuKX4Dz
2026-08-29 11:10:24 -04:00

36 lines
934 B
TypeScript

import { ComponentConfig } from '@reacteditor/core';
import type { ShopifyProduct } from '@reacteditor/plugin-shopify';
import { Tag } from 'lucide-react';
import ProductDetail from '@/components/shopify/product-detail';
export type ProductDetailBlockProps = {
product?: ShopifyProduct | null;
addToCartLabel?: string;
};
const productDetailEditor: ComponentConfig<ProductDetailBlockProps> = {
label: 'Product page',
icon: <Tag size={16} />,
category: 'commerce',
defaultProps: {
product: null,
addToCartLabel: 'Add to Cart',
},
fields: {
product: {
label: 'Product',
type: 'shopifyProduct',
} as any,
addToCartLabel: {
label: 'Add to cart label',
type: 'text',
contentEditable: true,
},
},
render: ({ product, addToCartLabel }) => (
<ProductDetail handle={product?.handle} addToCartLabel={addToCartLabel} />
),
};
export default productDetailEditor;