// // Copyright 2026 Novaloop AG // // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. // Please see LICENSE files in the repository root for full details. // import Combine import SwiftUI #if IS_MAIN_APP // Conforming to the nonisolated hook protocol would infer nonisolated, but the // flow it retains is main-actor state — the hook's requirement is @MainActor anyway. @MainActor final class HealthChatHomeTabsHook: HomeTabsHookProtocol { private var membersFlowCoordinator: HealthChatMembersFlowCoordinator? // Constructed during hook registration, before the main actor is reachable. nonisolated init() { } func makeExtraTab(flowParameters: CommonFlowParameters) -> (tab: NavigationTabCoordinator.Tab, actions: AnyPublisher)? { let flowCoordinator = HealthChatMembersFlowCoordinator(flowParameters: flowParameters) membersFlowCoordinator = flowCoordinator flowCoordinator.start() let details = NavigationTabCoordinator .TabDetails(tag: .members, title: HealthChatL10n.screenMemberDirectoryTitle, icon: \.userProfile, selectedIcon: \.userProfileSolid) return (tab: .init(coordinator: flowCoordinator.navigationStackCoordinator, details: details), actions: flowCoordinator.actionsPublisher) } } #endif