// IntelEmptyState — the HONEST empty state for an intelligence surface. When the
// synthesis service returns zero items, we say so plainly. We NEVER fabricate
// example opportunities or placeholder savings to fill the surface.
//
//   <window.IntelEmptyState
//      title="Nothing material to surface right now"
//      detail="…" />
//
// `tone="error"` renders the same calm layout for a fetch/synthesis failure.

(function () {
  const R = window.React;
  if (!R) return;

  function IntelEmptyState({ title, detail, tone }) {
    const isError = tone === "error";
    return R.createElement("div", {
      className: "pc-intel-empty",
      "data-intel-state": isError ? "error" : "empty",
      style: {
        border: "1px dashed var(--border,#d0d5dd)", borderRadius: 12,
        padding: "28px 24px", textAlign: "center",
        background: "var(--surface-1,#fff)",
      },
    },
      R.createElement("div", {
        style: { fontSize: 15, fontWeight: 600, color: isError ? "var(--warning,#b45309)" : "var(--text-1,#111)", marginBottom: 6 },
      }, title || (isError ? "Couldn't generate insights right now" : "Nothing material to surface right now")),
      R.createElement("div", {
        style: { fontSize: 13, color: "var(--text-2,#667085)", maxWidth: 520, margin: "0 auto", lineHeight: 1.5 },
      }, detail || (isError
        ? "The intelligence service didn't respond. Your dashboard data below is unaffected."
        : "We reviewed your financials and found nothing that rises to the level of a CFO-grade action this period. We'll surface items here as soon as the data shows something worth your attention."))
    );
  }

  window.IntelEmptyState = IntelEmptyState;
})();
