'use client'; // Modal shown the first time a plugin is enabled, listing every permission // the plugin's manifest declares. Accepting persists the grant on the // plugin record so future enables skip the prompt. import React, { useEffect, useSyncExternalStore } from 'react'; import { head, resolveHead, subscribe, describePermission } from '@/lib/plugin-sandbox/consent'; export function PluginConsentDialog(): React.JSX.Element | null { const current = useSyncExternalStore(subscribe, head, () => null); useEffect(() => { if (!current) return; function onKey(e: KeyboardEvent) { if (e.key === 'Escape') { e.preventDefault(); resolveHead(false); } } document.addEventListener('keydown', onKey, true); return () => document.removeEventListener('keydown', onKey, true); }, [current]); if (!current) return null; return (
{ if (e.target === e.currentTarget) resolveHead(false); }} >

This plugin is requesting the permissions below. You can revoke them by uninstalling the plugin.

Plugin: {current.pluginId}
); }