|
1 | 1 | import SwiftUI |
| 2 | +import enum Yosemite.AISource |
2 | 3 |
|
3 | 4 | /// Hosting controller for `AddProductWithAIActionSheet`. |
4 | 5 | /// |
@@ -38,6 +39,10 @@ struct AddProductWithAIActionSheet: View { |
38 | 39 | self.onAIOption = onAIOption |
39 | 40 | self.onProductTypeOption = onProductTypeOption |
40 | 41 | } |
| 42 | + |
| 43 | + private var aiSource: AISource { |
| 44 | + ServiceLocator.featureFlagService.isFeatureFlagEnabled(.allowMerchantAIAPIKey) ? .merchant : .jetpack |
| 45 | + } |
41 | 46 |
|
42 | 47 | var body: some View { |
43 | 48 | ScrollView { |
@@ -70,8 +75,16 @@ struct AddProductWithAIActionSheet: View { |
70 | 75 | VStack(alignment: .leading, spacing: Constants.verticalSpacing) { |
71 | 76 | Text(Localization.CreateProductWithAI.aiTitle) |
72 | 77 | .bodyStyle() |
73 | | - Text(Localization.CreateProductWithAI.aiDescription) |
74 | | - .subheadlineStyle() |
| 78 | + |
| 79 | + switch aiSource { |
| 80 | + case .merchant: |
| 81 | + Text(Localization.CreateProductWithAI.merchantAIDescription) |
| 82 | + .subheadlineStyle() |
| 83 | + case .jetpack: |
| 84 | + Text(Localization.CreateProductWithAI.aiDescription) |
| 85 | + .subheadlineStyle() |
| 86 | + } |
| 87 | + |
75 | 88 | AdaptiveStack(horizontalAlignment: .leading) { |
76 | 89 | Text(Localization.CreateProductWithAI.legalText) |
77 | 90 | Text(.init(Localization.CreateProductWithAI.learnMore)) |
@@ -161,6 +174,11 @@ private extension AddProductWithAIActionSheet { |
161 | 174 | value: "Let us generate product details for you", |
162 | 175 | comment: "Description of the option to add new product with AI assistance" |
163 | 176 | ) |
| 177 | + static let merchantAIDescription = NSLocalizedString( |
| 178 | + "addProductWithAIActionSheet.createProductWithAI.merchantAiDescription", |
| 179 | + value: "Generate product details using AI. Enter your API key under Settings > AI Settings", |
| 180 | + comment: "Description of the option to add new product with AI assistance" |
| 181 | + ) |
164 | 182 | static let legalText = NSLocalizedString( |
165 | 183 | "addProductWithAIActionSheet.createProductWithAI.legalText", |
166 | 184 | value: "Powered by AI.", |
|
0 commit comments