diff --git a/projects/js-packages/ai-client/changelog/remove-cancel-button-on-blank-ai-assistant b/projects/js-packages/ai-client/changelog/remove-cancel-button-on-blank-ai-assistant new file mode 100644 index 0000000000000..46b252a0bfddd --- /dev/null +++ b/projects/js-packages/ai-client/changelog/remove-cancel-button-on-blank-ai-assistant @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +AI Client: add showRemove attribute for ai-control diff --git a/projects/js-packages/ai-client/src/components/ai-control/index.tsx b/projects/js-packages/ai-client/src/components/ai-control/index.tsx index 4e6878dfed285..4d8abb26d6199 100644 --- a/projects/js-packages/ai-client/src/components/ai-control/index.tsx +++ b/projects/js-packages/ai-client/src/components/ai-control/index.tsx @@ -41,6 +41,7 @@ type AiControlProps = { onStop?: () => void; onAccept?: () => void; onDiscard?: () => void; + showRemove?: boolean; }; // eslint-disable-next-line @typescript-eslint/no-empty-function @@ -70,6 +71,7 @@ export function AIControl( onStop = noop, onAccept = noop, onDiscard = null, + showRemove = false, }: AiControlProps, ref: React.MutableRefObject< null > // eslint-disable-line @typescript-eslint/ban-types ): React.ReactElement { @@ -188,7 +190,7 @@ export function AIControl( ) } - { ! editRequest && ! value?.length && onDiscard && ( + { showRemove && ! editRequest && ! value?.length && onDiscard && (