mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
This commit is contained in:
parent
fc53c18fa4
commit
26334b5111
1 changed files with 6 additions and 1 deletions
|
@ -11,6 +11,7 @@ import type { Message } from '@kbn/elastic-assistant';
|
|||
import React, { useCallback } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
|
||||
import { useAssistantContext } from '@kbn/elastic-assistant/impl/assistant_context';
|
||||
import { useKibana, useToasts } from '../../common/lib/kibana';
|
||||
import type { Note } from '../../common/lib/note';
|
||||
import { appActions } from '../../common/store/actions';
|
||||
|
@ -28,6 +29,8 @@ const CommentActionsComponent: React.FC<Props> = ({ message }) => {
|
|||
const { cases } = useKibana().services;
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const { showAssistantOverlay } = useAssistantContext();
|
||||
|
||||
const associateNote = useCallback(
|
||||
(noteId: string) => dispatch(timelineActions.addNote({ id: TimelineId.active, noteId })),
|
||||
[dispatch]
|
||||
|
@ -57,6 +60,8 @@ const CommentActionsComponent: React.FC<Props> = ({ message }) => {
|
|||
});
|
||||
|
||||
const onAddToExistingCase = useCallback(() => {
|
||||
showAssistantOverlay({ showOverlay: false });
|
||||
|
||||
selectCaseModal.open({
|
||||
getAttachments: () => [
|
||||
{
|
||||
|
@ -66,7 +71,7 @@ const CommentActionsComponent: React.FC<Props> = ({ message }) => {
|
|||
},
|
||||
],
|
||||
});
|
||||
}, [message.content, selectCaseModal]);
|
||||
}, [message.content, selectCaseModal, showAssistantOverlay]);
|
||||
|
||||
return (
|
||||
<EuiFlexGroup alignItems="center" gutterSize="none">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue