|
2 | 2 | aiFormSchemaResolver, |
3 | 3 | AiSettingsFormSchema, |
4 | 4 | } from '@/app/features/ai/lib/ai-form-utils'; |
| 5 | +import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name'; |
5 | 6 | import { ConnectionSelect } from '@/app/features/builder/step-settings/block-settings/connection-select'; |
6 | 7 | import { |
7 | 8 | BlockMetadataModel, |
@@ -40,6 +41,9 @@ const AiSettingsForm = ({ |
40 | 41 | onSave, |
41 | 42 | isSaving, |
42 | 43 | }: AiSettingsFormProps) => { |
| 44 | + const assistantName = useAssistantName(); |
| 45 | + const isEnterprise = assistantName === t('OpenOps Agent'); |
| 46 | + |
43 | 47 | const form = useForm<AiSettingsFormSchema>({ |
44 | 48 | resolver: aiFormSchemaResolver, |
45 | 49 | defaultValues: EMPTY_FORM_VALUE, |
@@ -84,32 +88,43 @@ const AiSettingsForm = ({ |
84 | 88 | }); |
85 | 89 | }; |
86 | 90 |
|
| 91 | + const descriptionText = isEnterprise |
| 92 | + ? `Enables ${assistantName} and other AI-powered features such as the CLI command generation and chat interfaces.` |
| 93 | + : `Enables ${assistantName} and other AI-powered features such as the CLI command generation.`; |
| 94 | + |
87 | 95 | return ( |
88 | 96 | <Form {...form}> |
89 | | - <form className="flex-1 flex flex-col gap-4 max-w-[516px]"> |
| 97 | + <form className="flex-1 flex flex-col gap-4"> |
90 | 98 | <FormField |
91 | 99 | control={form.control} |
92 | 100 | name="enabled" |
93 | 101 | render={({ field }) => ( |
94 | | - <FormItem className="flex gap-[6px]"> |
95 | | - <Switch |
96 | | - id="enabled" |
97 | | - checked={field.value} |
98 | | - onCheckedChange={field.onChange} |
99 | | - /> |
100 | | - <Label htmlFor="enabled">{t('Enable AI')}</Label> |
| 102 | + <FormItem className="flex flex-col"> |
| 103 | + <div className="flex items-center gap-[6px]"> |
| 104 | + <Switch |
| 105 | + id="enabled" |
| 106 | + checked={field.value} |
| 107 | + onCheckedChange={field.onChange} |
| 108 | + /> |
| 109 | + <Label htmlFor="enabled">{t('Enable OpenOps AI')}</Label> |
| 110 | + </div> |
| 111 | + <p className="mt-8 text-base font-normal leading-6 text-primary-900"> |
| 112 | + {descriptionText} |
| 113 | + </p> |
101 | 114 | </FormItem> |
102 | 115 | )} |
103 | 116 | /> |
104 | | - <ConnectionSelect |
105 | | - disabled={!currentFormValue.enabled} |
106 | | - allowDynamicValues={false} |
107 | | - block={block} |
108 | | - providerKey={'AI'} |
109 | | - name={'connection'} |
110 | | - /> |
| 117 | + <div className="max-w-[516px]"> |
| 118 | + <ConnectionSelect |
| 119 | + disabled={!currentFormValue.enabled} |
| 120 | + allowDynamicValues={false} |
| 121 | + block={block} |
| 122 | + providerKey={'AI'} |
| 123 | + name={'connection'} |
| 124 | + /> |
| 125 | + </div> |
111 | 126 |
|
112 | | - <div className="flex items-center justify-between "> |
| 127 | + <div className="flex items-center justify-between max-w-[516px]"> |
113 | 128 | <div className="flex gap-2"> |
114 | 129 | <Button |
115 | 130 | variant="outline" |
|
0 commit comments