import React, { Suspense } from "react";

export default function MainTabContent({
  activeTab,
  TaskSettingsTab,
  AccountsTab,
  LogsTab,
  QueueTab,
  EventsTab,
  SettingsTab,
  taskSettingsProps,
  accountsTabProps,
  logsTabProps,
  queueTabProps,
  eventsTabProps,
  settingsTabProps
}) {
  return (
    <>
      {activeTab === "task" && (
        <TaskSettingsTab {...taskSettingsProps} />
      )}

      {activeTab === "accounts" && (
        <Suspense fallback={<div className="card">Загрузка...</div>}>
          <AccountsTab {...accountsTabProps} />
        </Suspense>
      )}

      {activeTab === "logs" && (
        <Suspense fallback={<div className="card">Загрузка...</div>}>
          <LogsTab {...logsTabProps} />
        </Suspense>
      )}

      {activeTab === "queue" && (
        <Suspense fallback={<div className="card">Загрузка...</div>}>
          <QueueTab {...queueTabProps} />
        </Suspense>
      )}

      {activeTab === "events" && (
        <Suspense fallback={<div className="card">Загрузка...</div>}>
          <EventsTab {...eventsTabProps} />
        </Suspense>
      )}

      {activeTab === "settings" && (
        <Suspense fallback={<div className="card">Загрузка...</div>}>
          <SettingsTab {...settingsTabProps} />
        </Suspense>
      )}
    </>
  );
}
