"use client";

import dynamic from "next/dynamic.js";

import React from "react";

const MetabaseProvider = ({ children, ...providerProps }) => {
  const Provider = dynamic(
    () =>
      import("./index.js").then((m) => {
        return { default: m.MetabaseProvider };
      }),
    {
      ssr: false,
      loading: () => {
        return React.createElement(
          "div",
          { id: "metabase-sdk-root" },
          children,
        );
      },
    },
  );

  return React.createElement(Provider, providerProps, children);
};

export { MetabaseProvider };

// === CollectionBrowser ===

const CollectionBrowser = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.CollectionBrowser };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { CollectionBrowser };

// === CreateDashboardModal ===

const CreateDashboardModal = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.CreateDashboardModal };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { CreateDashboardModal };

// === CreateQuestion ===

const CreateQuestion = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.CreateQuestion };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { CreateQuestion };

// === EditableDashboard ===

const EditableDashboard = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.EditableDashboard };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { EditableDashboard };

// === InteractiveDashboard ===

const InteractiveDashboard = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveDashboard };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { InteractiveDashboard };

// === InteractiveQuestion ===

const InteractiveQuestion = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.BackButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.BackButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Filter = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Filter };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.FilterDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.FilterDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.ResetButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.ResetButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Title = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Title };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Summarize = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Summarize };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.SummarizeDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.SummarizeDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Notebook = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Notebook };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Editor = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Editor };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.NotebookButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.NotebookButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.EditorButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.EditorButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.QuestionVisualization = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.QuestionVisualization };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.SaveQuestionForm = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.SaveQuestionForm };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.SaveButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.SaveButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.ChartTypeSelector = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.ChartTypeSelector };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.QuestionSettings = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.QuestionSettings };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.QuestionSettingsDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.QuestionSettingsDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.BreakoutDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.BreakoutDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.Breakout = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.Breakout };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.ChartTypeDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.ChartTypeDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.DownloadWidget = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.DownloadWidget };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.DownloadWidgetDropdown = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.DownloadWidgetDropdown };
    }),
  { ssr: false, loading: () => "Loading..." },
);

InteractiveQuestion.VisualizationButton = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.InteractiveQuestion.VisualizationButton };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { InteractiveQuestion };

// === ModifyQuestion ===

const ModifyQuestion = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.ModifyQuestion };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { ModifyQuestion };

// === StaticDashboard ===

const StaticDashboard = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.StaticDashboard };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { StaticDashboard };

// === StaticQuestion ===

const StaticQuestion = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.StaticQuestion };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { StaticQuestion };

// === SdkDebugInfo ===

const SdkDebugInfo = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.SdkDebugInfo };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { SdkDebugInfo };

// === MetabotQuestion ===

const MetabotQuestion = dynamic(
  () =>
    import("./index.js").then((m) => {
      return { default: m.MetabotQuestion };
    }),
  { ssr: false, loading: () => "Loading..." },
);

export { MetabotQuestion };
