# extendify/3.2.1/src/Agent/components/SharedBlockNotice.jsx

Extendify, version 3.2.1. 35 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Agent/components/SharedBlockNotice.jsx
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Agent/components/SharedBlockNotice.jsx
- Modified: 2026-09-09T18:23:40+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/extendify/3.2.1/code/src/Agent/components/SharedBlockNotice.jsx#L10-L20`.

```jsx
import {
	fetchSharedBlockUsage,
	isSharedBlockId,
	sharedBlockNotice,
} from '@agent/lib/shared-block-usage';
import { useEffect, useState } from '@wordpress/element';

export const SharedBlockNotice = ({ blockIds }) => {
	const [notice, setNotice] = useState(null);
	const shared = (Array.isArray(blockIds) ? blockIds : []).find((id) =>
		isSharedBlockId(id),
	);

	useEffect(() => {
		if (!shared) return setNotice(null);
		let live = true;
		fetchSharedBlockUsage(shared)
			.then((usage) => live && setNotice(sharedBlockNotice(usage)))
			// A missing scope must not block the save the user already reviewed.
			.catch(() => live && setNotice(null));
		return () => {
			live = false;
		};
	}, [shared]);

	if (!notice) return null;

	return (
		<p className="m-0 mt-2 p-0 text-sm text-gray-700">
			<span aria-hidden="true">⚠ </span>
			<span>{notice}</span>
		</p>
	);
};

```
