# post-carousel/4.0.8/src/blocks/smart-search/block.js

Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog &amp; News, version 4.0.8. 34 lines.

- Page: https://pluginprobe.com/plugins/post-carousel/4.0.8/code/src/blocks/smart-search/block.js
- Raw: https://pluginprobe.com/plugins/post-carousel/4.0.8/raw/src/blocks/smart-search/block.js
- Modified: 2026-09-02T10:51:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/post-carousel/4.0.8/code/src/blocks/smart-search/block.js#L10-L20`.

```javascript
import { registerBlockType } from "@wordpress/blocks";
import SmartSearchEdit from "./edit";
import generateBlockCSS from "../shared/generateBlockCSS";
import { SearchBlockIcon, SmartSearchPreviewImage } from "./icons";
import { isBlockEnabled } from "../../utils";

const options = {
	apiVersion: 3,
	icon: SearchBlockIcon,
	category: "sp-smart-post-show-pro-blocks",
	name: "sp-smart-post-show/smart-search",
	title: "Smart Search",
	description: "Enable visitors to instantly find content with a stylish, powerful live search.",
	supports: {
		align: ["wide", "full"],
	},
	example: {
		attributes: {
			isPreview: true,
		},
	},
	edit: (props) => (props.attributes.isPreview ? <SmartSearchPreviewImage /> : <SmartSearchEdit {...props} />),
	save: () => null,
	generateCSS: (attributes) => generateBlockCSS(attributes, "sp-smart-post-show/smart-search", "frontend"),
};

const registerBlockTypeFn = () => {
	if (isBlockEnabled(options.name)) {
		registerBlockType(options.name, options);
	}
};

registerBlockTypeFn();

```
