export default function useTabProps(
  taskSettings,
  accountsTab,
  logsTab,
  queueTab,
  eventsTab,
  settingsTab
) {
  const {
    selectedTaskName,
    taskForm,
    setTaskForm,
    activePreset,
    applyTaskPreset,
    formatAccountLabel,
    accountById,
    competitorText,
    setCompetitorText,
    roleMode,
    applyRoleMode,
    normalizeIntervals,
    taskStatus,
    perAccountInviteSum,
    hasSelectedTask,
    inviteAccessStatus,
    inviteAccessCheckedAt,
    formatTimestamp,
    checkInviteAccess,
    accounts,
    showNotification,
    copyToClipboard,
    sanitizeTaskForm,
    hasPerAccountInviteLimits,
    fileImportResult,
    importInviteFile,
    fileImportForm,
    setFileImportForm,
    criticalErrorAccounts
  } = taskSettings;
  const {
    accountStatsMap,
    settings,
    membershipStatus,
    assignedAccountMap,
    accountBuckets,
    filterFreeAccounts,
    selectedAccountIds,
    taskAccountRoles,
    rolesMode,
    setRolesMode,
    inviteAdminMasterId,
    refreshMembership,
    refreshIdentity,
    formatAccountStatus,
    resetCooldown,
    deleteAccount,
    updateAccountRole,
    updateAccountInviteLimit,
    setAccountRolesAll,
    applyRolePreset,
    removeAccountFromTask,
    moveAccountToTask
  } = accountsTab;
  const {
    logsTab: logsTabName,
    setLogsTab,
    exportLogs,
    clearLogs,
    exportInvites,
    exportProblemInvites,
    exportFallback,
    updateFallbackStatus,
    clearFallback,
    clearInvites,
    logSearch,
    setLogSearch,
    logPage,
    setLogPage,
    logPageCount,
    pagedLogs,
    inviteSearch,
    setInviteSearch,
    invitePage,
    setInvitePage,
    invitePageCount,
    inviteFilter,
    setInviteFilter,
    pagedInvites,
    fallbackSearch,
    setFallbackSearch,
    fallbackPage,
    setFallbackPage,
    fallbackPageCount,
    pagedFallback,
    confirmQueue,
    confirmSearch,
    setConfirmSearch,
    confirmPage,
    setConfirmPage,
    confirmPageCount,
    pagedConfirmQueue,
    clearConfirmQueue,
    auditSearch,
    setAuditSearch,
    auditPage,
    setAuditPage,
    auditPageCount,
    pagedAudit,
    explainInviteError,
    expandedInviteId,
    setExpandedInviteId,
    inviteStats,
    invites,
    selectedTask,
    accessStatus,
    roleSummary,
    mutualContactDiagnostics
  } = logsTab;
  const {
    queueStats,
    queueSearch,
    setQueueSearch,
    queuePage,
    setQueuePage,
    queuePageCount,
    pagedQueue
  } = queueTab;
  const {
    accountEvents,
    onClearEvents
  } = eventsTab;
  const {
    onSettingsChange,
    saveSettings
  } = settingsTab;
  const taskSettingsProps = {
    selectedTaskName,
    taskForm,
    setTaskForm,
    activePreset,
    applyTaskPreset,
    formatAccountLabel,
    accountById,
    competitorText,
    setCompetitorText,
    roleMode,
    applyRoleMode,
    normalizeIntervals,
    taskStatus,
    perAccountInviteSum,
    hasSelectedTask,
    inviteAccessStatus,
    inviteAccessCheckedAt,
    formatTimestamp,
    checkInviteAccess,
    accounts,
    showNotification,
    copyToClipboard,
    sanitizeTaskForm,
    hasPerAccountInviteLimits,
    fileImportResult,
    importInviteFile,
    fileImportForm,
    setFileImportForm,
    criticalErrorAccounts
  };

  const accountsTabProps = {
    accounts,
    accountStatsMap,
    settings,
    membershipStatus,
    assignedAccountMap,
    accountBuckets,
    filterFreeAccounts,
    selectedAccountIds,
    taskAccountRoles,
    rolesMode,
    setRolesMode,
    hasSelectedTask,
    inviteAdminMasterId,
    refreshMembership,
    refreshIdentity,
    formatAccountStatus,
    formatAccountLabel,
    resetCooldown,
    deleteAccount,
    updateAccountRole,
    updateAccountInviteLimit,
    setAccountRolesAll,
    applyRolePreset,
    removeAccountFromTask,
    moveAccountToTask
  };

  const logsTabProps = {
    logsTab: logsTabName,
    setLogsTab,
    hasSelectedTask,
    exportLogs,
    clearLogs,
    exportInvites,
    exportProblemInvites,
    exportFallback,
    updateFallbackStatus,
    clearFallback,
    clearInvites,
    logSearch,
    setLogSearch,
    logPage,
    setLogPage,
    logPageCount,
    pagedLogs,
    inviteSearch,
    setInviteSearch,
    invitePage,
    setInvitePage,
    invitePageCount,
    inviteFilter,
    setInviteFilter,
    pagedInvites,
    fallbackSearch,
    setFallbackSearch,
    fallbackPage,
    setFallbackPage,
    fallbackPageCount,
    pagedFallback,
    confirmQueue,
    confirmSearch,
    setConfirmSearch,
    confirmPage,
    setConfirmPage,
    confirmPageCount,
    pagedConfirmQueue,
    clearConfirmQueue,
    auditSearch,
    setAuditSearch,
    auditPage,
    setAuditPage,
    auditPageCount,
    pagedAudit,
    formatTimestamp,
    explainInviteError,
    expandedInviteId,
    setExpandedInviteId,
    inviteStats,
    invites,
    selectedTask,
    taskAccountRoles,
    accessStatus,
    inviteAccessStatus,
    selectedTaskName,
    roleSummary,
    mutualContactDiagnostics,
    accountById,
    formatAccountLabel
  };
  const queueTabProps = {
    hasSelectedTask,
    queueStats,
    queueSearch,
    setQueueSearch,
    queuePage,
    setQueuePage,
    queuePageCount,
    pagedQueue,
    accountById,
    formatAccountLabel,
    formatTimestamp
  };

  const eventsTabProps = {
    accountEvents,
    formatTimestamp,
    onClearEvents,
    accountById,
    formatAccountLabel
  };

  const settingsTabProps = {
    settings,
    onSettingsChange,
    saveSettings
  };

  return {
    taskSettingsProps,
    accountsTabProps,
    logsTabProps,
    queueTabProps,
    eventsTabProps,
    settingsTabProps
  };
}
