Files
shopify-react-editor-template/components/shopify/product-recommendations.config.tsx
T
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

40 lines
1.1 KiB
TypeScript

import { ComponentConfig } from '@reacteditor/core';
import type { ShopifyProduct } from '@reacteditor/plugin-shopify';
import { Sparkles } from 'lucide-react';
import ProductRecommendations from '@/components/shopify/product-recommendations';
export type ProductRecommendationsBlockProps = {
title?: string;
product?: ShopifyProduct | null;
limit?: number;
};
const productRecommendationsEditor: ComponentConfig<ProductRecommendationsBlockProps> =
{
label: 'Recommended products',
icon: <Sparkles size={16} />,
category: 'commerce',
defaultProps: {
title: 'You May Also Like',
product: null,
limit: 4,
},
fields: {
title: { label: 'Title', type: 'text', contentEditable: true },
product: {
label: 'Seed product',
type: 'shopifyProduct',
} as any,
limit: { label: 'Products shown', type: 'number', min: 2, max: 12 },
},
render: ({ title, product, limit }) => (
<ProductRecommendations
title={title}
handle={product?.handle}
limit={limit}
/>
),
};
export default productRecommendationsEditor;