Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions routes/ai-home/stage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Page } from '@wordpress/admin-ui';
import {
Button,
ExternalLink,
Notice,
Spinner,
ToggleControl,
} from '@wordpress/components';
Expand All @@ -17,7 +16,7 @@ import { useCallback, useMemo, useState } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { info as infoIcon } from '@wordpress/icons';
import { store as noticesStore } from '@wordpress/notices';
import { Icon, Popover, VisuallyHidden } from '@wordpress/ui';
import { Icon, Notice, Popover, VisuallyHidden } from '@wordpress/ui';

/**
* Internal dependencies
Expand Down Expand Up @@ -939,25 +938,31 @@ function AISettingsPage() {
>
<div className="ai-settings-page">
{ ! PAGE_DATA.hasValidCredentials && (
<Notice status="error" isDismissible={ false }>
{ ! PAGE_DATA.hasCredentials
? __(
'The AI plugin requires a valid AI Connector to function properly. Verify you have one or more AI Connectors configured.',
'ai'
)
: __(
'The AI plugin requires a valid AI Connector to function properly. Please review the AI Connectors you have configured to ensure they are valid.',
'ai'
) }{ ' ' }
<Notice.Root
className="ai-settings-page__notice"
intent="error"
>
<Notice.Description>
{ ! PAGE_DATA.hasCredentials
? __(
'The AI plugin requires a valid AI Connector to function properly. Verify you have one or more AI Connectors configured.',
'ai'
)
: __(
'The AI plugin requires a valid AI Connector to function properly. Please review the AI Connectors you have configured to ensure they are valid.',
'ai'
) }
</Notice.Description>
{ PAGE_DATA.connectorsUrl && (
<Button
variant="link"
href={ PAGE_DATA.connectorsUrl }
>
{ __( 'Manage Connectors', 'ai' ) }
</Button>
<Notice.Actions>
<Notice.ActionLink
href={ PAGE_DATA.connectorsUrl }
>
{ __( 'Manage Connectors', 'ai' ) }
</Notice.ActionLink>
</Notice.Actions>
) }
</Notice>
</Notice.Root>
) }
{ isLoading ? (
<Spinner />
Expand Down
4 changes: 2 additions & 2 deletions routes/ai-home/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
}
}

.ai-settings-page .components-notice {
margin: 0 0 24px;
.ai-settings-page__notice {
margin-bottom: 24px;
}

.ai-settings-page__actions {
Expand Down
Loading