Skip to content

Commit 39e4621

Browse files
committed
update product creation ai sheet based on ai source
1 parent 2b5461e commit 39e4621

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

WooCommerce/Classes/ViewRelated/Products/Add Product/AddProductWithAI/EntryPoint/AddProductWithAIActionSheet.swift

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import SwiftUI
2+
import enum Yosemite.AISource
23

34
/// Hosting controller for `AddProductWithAIActionSheet`.
45
///
@@ -38,6 +39,10 @@ struct AddProductWithAIActionSheet: View {
3839
self.onAIOption = onAIOption
3940
self.onProductTypeOption = onProductTypeOption
4041
}
42+
43+
private var aiSource: AISource {
44+
ServiceLocator.featureFlagService.isFeatureFlagEnabled(.allowMerchantAIAPIKey) ? .merchant : .jetpack
45+
}
4146

4247
var body: some View {
4348
ScrollView {
@@ -70,8 +75,16 @@ struct AddProductWithAIActionSheet: View {
7075
VStack(alignment: .leading, spacing: Constants.verticalSpacing) {
7176
Text(Localization.CreateProductWithAI.aiTitle)
7277
.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+
7588
AdaptiveStack(horizontalAlignment: .leading) {
7689
Text(Localization.CreateProductWithAI.legalText)
7790
Text(.init(Localization.CreateProductWithAI.learnMore))
@@ -161,6 +174,11 @@ private extension AddProductWithAIActionSheet {
161174
value: "Let us generate product details for you",
162175
comment: "Description of the option to add new product with AI assistance"
163176
)
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+
)
164182
static let legalText = NSLocalizedString(
165183
"addProductWithAIActionSheet.createProductWithAI.legalText",
166184
value: "Powered by AI.",

0 commit comments

Comments
 (0)