Files
react-editor-shopify/editor/components/commerce/collection.editor.tsx
2026-05-03 20:12:12 -04:00

27 lines
845 B
TypeScript

import { ComponentConfig } from "@reacteditor/core";
import { FolderOpen } from "lucide-react";
import { CollectionView, type CollectionProps } from "@/editor/components/commerce/collection";
export function createCollectionEditor(opts: {
collectionField: any;
}): ComponentConfig<CollectionProps> {
return {
label: "Collection page",
icon: <FolderOpen size={16} />,
category: "commerce",
defaultProps: { collection: null, showDescription: "no" },
fields: {
collection: { label: "Collection", ...opts.collectionField },
showDescription: {
label: "Description",
type: "radio",
options: [
{ label: "Hide description", value: "no" },
{ label: "Show description", value: "yes" },
],
},
},
render: (props) => <CollectionView {...props} />,
};
}