/**
 * Menu → Feedback (drawer): suggestion feedback (moved from Micro-Action detail).
 * Uses MicroActionSuggestionFeedbackForm + session pending bridge after POI select.
 */
(function() {
  'use strict';

  const { useRef } = React;

  function FeedbackInApp({ tabParams }) {
    const containerRef = useRef(null);
    const title =
      (typeof window !== 'undefined' && window.SylvanFlowState?.getLanguage?.() === 'zh-CN')
        ? '反馈'
        : 'Feedback';

    return (
      <div ref={containerRef} className="w-full h-full overflow-y-auto bg-white">
        <div className="max-w-2xl mx-auto p-4">
          <h2 className="text-2xl font-bold mb-4 text-slate-800">{title}</h2>
          {window.MicroActionSuggestionFeedbackForm ? (
            React.createElement(window.MicroActionSuggestionFeedbackForm, { tabParams })
          ) : (
            <p className="text-slate-600 text-sm">Loading feedback form…</p>
          )}
        </div>
      </div>
    );
  }

  if (typeof window !== 'undefined') {
    window.FeedbackInApp = FeedbackInApp;
  }
})();
