import type { ComponentProps } from 'react';

import { ChannelConfigModal, TopicConfigModal } from './DashboardChannelTopicModals';
import { BaseConfigModal, ParamConfigModal, ResourceMonitorModal } from './DashboardConfigModals';
import { McpConfigModal, SkillsModal } from './DashboardSkillsMcpModals';
import { AgentFilesModal, CronJobsModal, EnvParamsModal, RuntimeActionModal, TemplateManagerModal } from './DashboardSupportModals';
import { SkillMarketInstallModal } from './SkillMarketInstallModal';
import { WorkspaceHoverCard } from './WorkspaceHoverCard';
import { WorkspacePreviewModal } from './WorkspacePreviewModal';

interface DashboardModalStackProps {
  agentFilesModal: ComponentProps<typeof AgentFilesModal>;
  baseConfigModal: ComponentProps<typeof BaseConfigModal>;
  channelConfigModal: ComponentProps<typeof ChannelConfigModal>;
  cronJobsModal: ComponentProps<typeof CronJobsModal>;
  envParamsModal: ComponentProps<typeof EnvParamsModal>;
  mcpConfigModal: ComponentProps<typeof McpConfigModal>;
  paramConfigModal: ComponentProps<typeof ParamConfigModal>;
  resourceMonitorModal: ComponentProps<typeof ResourceMonitorModal>;
  runtimeActionModal: ComponentProps<typeof RuntimeActionModal>;
  skillMarketInstallModal: ComponentProps<typeof SkillMarketInstallModal>;
  skillsModal: ComponentProps<typeof SkillsModal>;
  templateManagerModal: ComponentProps<typeof TemplateManagerModal>;
  topicConfigModal: ComponentProps<typeof TopicConfigModal>;
  workspaceHoverCard: ComponentProps<typeof WorkspaceHoverCard>;
  workspacePreviewModal: ComponentProps<typeof WorkspacePreviewModal>;
}

export function DashboardModalStack({
  agentFilesModal,
  baseConfigModal,
  channelConfigModal,
  cronJobsModal,
  envParamsModal,
  mcpConfigModal,
  paramConfigModal,
  resourceMonitorModal,
  runtimeActionModal,
  skillMarketInstallModal,
  skillsModal,
  templateManagerModal,
  topicConfigModal,
  workspaceHoverCard,
  workspacePreviewModal,
}: DashboardModalStackProps) {
  return (
    <>
      <ResourceMonitorModal {...resourceMonitorModal} />
      <BaseConfigModal {...baseConfigModal} />
      <ParamConfigModal {...paramConfigModal} />
      <ChannelConfigModal {...channelConfigModal} />
      <TopicConfigModal {...topicConfigModal} />
      <SkillsModal {...skillsModal} />
      <SkillMarketInstallModal {...skillMarketInstallModal} />
      <McpConfigModal {...mcpConfigModal} />
      <EnvParamsModal {...envParamsModal} />
      <CronJobsModal {...cronJobsModal} />
      <TemplateManagerModal {...templateManagerModal} />
      <AgentFilesModal {...agentFilesModal} />
      <RuntimeActionModal {...runtimeActionModal} />
      <WorkspacePreviewModal {...workspacePreviewModal} />
      <WorkspaceHoverCard {...workspaceHoverCard} />
    </>
  );
}
