import { InspectorControls } from "@wordpress/block-editor"; import { PanelBody, TextControl, RangeControl, SelectControl, ToggleControl, } from "@wordpress/components"; import { __ } from "@wordpress/i18n"; import ServerSideRender from "@wordpress/server-side-render"; interface TourBlockAttributes { order: "desc" | "asc"; featured: boolean; per_page: number; columns: number; title: string; show_pagination: boolean; } interface EditProps { attributes: TourBlockAttributes; setAttributes: (attrs: Partial) => void; } export default function Edit({ attributes, setAttributes }: EditProps) { return ( <> setAttributes({ title: value })} /> setAttributes({ order: value as "asc" | "desc" }) } /> setAttributes({ per_page: value || 10 })} min={1} max={50} /> setAttributes({ columns: value !== undefined && value !== null ? value : 3, }) } min={1} max={6} /> setAttributes({ featured: value })} /> setAttributes({ show_pagination: value })} />
); }