# post-carousel/4.0.7/src/blocks/button/inspect.js

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

- Page: https://pluginprobe.com/plugins/post-carousel/4.0.7/code/src/blocks/button/inspect.js
- Raw: https://pluginprobe.com/plugins/post-carousel/4.0.7/raw/src/blocks/button/inspect.js
- Modified: 2026-04-24T11:48:54+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.7/code/src/blocks/button/inspect.js#L10-L20`.

```javascript
import { __ } from "@wordpress/i18n";
import { PanelBody } from "@wordpress/components";
import { useState } from "@wordpress/element";
import { TabControls } from "../../components";
import { AdvancedTab, VisibilityTab } from "../shared/advancedTab";
import { SmartBtnGeneralTab, SmartBtnIconTab, SmartBtnLabelTab } from "./sidebarControl";

const Inspector = ({ attributes, setAttributes }) => {
	const [togglePanel, setTogglePanel] = useState("general");

	const toggleHandler = (toggleVal, tabName) => {
		setTogglePanel(toggleVal ? tabName : "");
	};

	return (
		<>
			<PanelBody
				title={__("General", "post-carousel")}
				opened={togglePanel === "general"}
				onToggle={(value) => toggleHandler(value, "general")}
			>
				<SmartBtnGeneralTab attributes={attributes} setAttributes={setAttributes} />
			</PanelBody>
			<PanelBody
				title={__("Button Label", "post-carousel")}
				opened={togglePanel === "buttonLabel"}
				onToggle={(value) => toggleHandler(value, "buttonLabel")}
			>
				<SmartBtnLabelTab attributes={attributes} setAttributes={setAttributes} />
			</PanelBody>

			<PanelBody
				title={__("Icon", "post-carousel")}
				className="sp-button-icon-panel-body"
				opened={togglePanel === "icon"}
				onToggle={(value) => toggleHandler(value, "icon")}
			>
				<SmartBtnIconTab attributes={attributes} setAttributes={setAttributes} />
			</PanelBody>
			<PanelBody
				title={__("Advanced", "post-carousel")}
				opened={togglePanel === "advanced"}
				onToggle={(value) => toggleHandler(value, "advanced")}
			>
				{togglePanel === "advanced" && (
					<TabControls
						attributes={attributes}
						setAttributes={setAttributes}
						AdvancedTab={AdvancedTab}
						VisibilityTab={VisibilityTab}
						displayIcon={false}
						initialTab={"visibility"}
					/>
				)}
			</PanelBody>
		</>
	);
};

export default Inspector;

```
