import Localization
import SwiftUI

public struct InstrumentalToggleView: View {
    @Binding var isOn: Bool
    let onTapTextAction: () -> Void

    public init(
        isOn: Binding<Bool>,
        onTapTextAction: @escaping () -> Void
    ) {
        self._isOn = isOn
        self.onTapTextAction = onTapTextAction
    }

    public var body: some View {
        HStack(alignment: .center, spacing: 8) {
            Text(L10n.FeatureCreateClip.instrumental)
                .typographyV1(.body1)
                .foregroundStyle(Color.SemanticV1.textPrimary)
                .onTapGesture {
                    onTapTextAction()
                }
            Toggle(isOn: $isOn) {}
                .scaleEffect(0.8)
                .labelsHidden()
                .tint(.SemanticV1.iconLink)
        }
    }
}
