import { __ } from "@wordpress/i18n"; import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; import "./editor.scss"; import { useSelect } from "@wordpress/data"; export default function Edit({ attributes, setAttributes, ...props }) { const years = useSelect( (select) => { const { getBlocks } = select("core/block-editor"); const childBlocks = getBlocks(props.clientId) || []; return childBlocks .filter((b) => b.name === "carhop-blocks/highlight-timeline-step") .map((b) => b.attributes?.year) .filter((y) => y !== undefined && y !== null && y !== ""); }, [props.clientId] ); return (