import ComponentLibrary
import ComposableArchitecture
import FeatureHooksGrid
import Localization
import SwiftUI
import Utilities

public struct UserHooksScreen: View {
    @Bindable var store: StoreOf<UserHooksReducer>

    public init(store: StoreOf<UserHooksReducer>) {
        self.store = store
    }

    public var body: some View {
        HooksGridScreen(store: store.scope(state: \.hooksGrid, action: \.hooksGrid))
            .background(Color.SemanticV1.backgroundPrimary)
            .toolbar {
                ToolbarItem(placement: .principal) {
                    ToolbarTitle(L10n.FeatureCatalog.hooks)
                }
            }
            .task {
                store.send(.hooksGrid(.task))
            }
    }
}
