import React from 'react';
import AddAPIDialog from '@/components/api-tester/AddAPIDialog.jsx';
import AddCollectionDialog from '@/components/api-tester/AddCollectionDialog.jsx';
import AddScenarioDialog from '@/components/api-tester/AddScenarioDialog.jsx';
import VariableModal from '@/components/api-tester/VariableModal.jsx';
import MockRouteEditDialog from '@/components/mock-route/MockRouteEditDialog.jsx';
import TCPServerEditDialog from '@/components/tcp-servers/TCPServerEditDialog.jsx';
import QueueEditDialog from '@/components/queues/QueueEditDialog.jsx';
import UserEditDialog from '@/components/users/UserEditDialog.jsx';
import PasswordChangeDialog from '@/components/account/PasswordChangeDialog.jsx';
import ServerEditDialog from '@/components/servers/ServerEditDialog.jsx';

const DialogManager = ({
  showAddApi,
  showAddCollection,
  showAddScenario,
  showVariableModal,
  showMockRouteEdit,
  showTCPServerEdit,
  showQueueEdit,
  showUserEdit,
  showServerEdit,
  selectedItem,
  showPasswordChange,
  onDialogChange
}) => {
  return (
      <>
        <AddCollectionDialog
            open={showAddCollection}
            onOpenChange={(isOpen) => onDialogChange('showAddCollection', isOpen)}
        />
        <AddAPIDialog
            open={showAddApi}
            onOpenChange={(isOpen) => onDialogChange('showAddApi', isOpen)}
        />
        <AddScenarioDialog
            open={showAddScenario}
            onOpenChange={(isOpen) => onDialogChange('showAddScenario', isOpen)}
        />
        <VariableModal
            open={showVariableModal}
            onOpenChange={(isOpen) => onDialogChange('showVariableModal', isOpen)}
        />
        <MockRouteEditDialog
            open={showMockRouteEdit}
            onOpenChange={(isOpen) => onDialogChange('showMockRouteEdit', isOpen)}
            item={selectedItem}
        />
        <TCPServerEditDialog
            open={showTCPServerEdit}
            onOpenChange={(isOpen) => onDialogChange('showTCPServerEdit', isOpen)}
            item={selectedItem}
        />
        <QueueEditDialog
            open={showQueueEdit}
            onOpenChange={(isOpen) => onDialogChange('showQueueEdit', isOpen)}
            item={selectedItem}
        />
        <UserEditDialog
            open={showUserEdit}
            onOpenChange={(isOpen) => onDialogChange('showUserEdit', isOpen)}
            item={selectedItem}
        />
        <PasswordChangeDialog
            open={showPasswordChange}
            onOpenChange={(isOpen) => onDialogChange('showPasswordChange', isOpen)}
        />
        <ServerEditDialog
            open={showServerEdit}
            onOpenChange={(isOpen) => onDialogChange('showServerEdit', isOpen)}
            item={selectedItem}
        />
      </>
  );
};

export default DialogManager;
