Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9172fe5
cleanup welcome convo
stephmilovic Aug 5, 2024
3f133fa
more wip
stephmilovic Aug 5, 2024
00aca9f
more
stephmilovic Aug 6, 2024
6dc33a8
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 6, 2024
67e4877
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 7, 2024
aacc48d
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 7, 2024
476c353
it practically works
stephmilovic Aug 7, 2024
de63956
update
stephmilovic Aug 7, 2024
ed77db6
fix type
stephmilovic Aug 8, 2024
03a1825
fix useEffect
stephmilovic Aug 8, 2024
8294f72
another great fix
stephmilovic Aug 8, 2024
952e0c8
fix tests
stephmilovic Aug 8, 2024
7ba2f75
add test
stephmilovic Aug 8, 2024
d169910
remove unused files
stephmilovic Aug 8, 2024
7814717
fixes
stephmilovic Aug 8, 2024
eabd4b4
update quick prompt color
stephmilovic Aug 8, 2024
65ef9f4
fix test
stephmilovic Aug 8, 2024
fe36c24
more better?
stephmilovic Aug 9, 2024
74d4d42
comment
stephmilovic Aug 12, 2024
42ec4c1
rm unused consts
stephmilovic Aug 12, 2024
1453e91
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 12, 2024
d4628e3
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 12, 2024
2677caf
fix type
stephmilovic Aug 12, 2024
0d79e29
fix
stephmilovic Aug 12, 2024
aa90c5d
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 12, 2024
b8b9fc9
fix translations
stephmilovic Aug 12, 2024
6905d68
Merge branch 'main' into assistant_package_cleanup
stephmilovic Aug 13, 2024
d230696
fix loading
stephmilovic Aug 13, 2024
7926944
fix connector icons
stephmilovic Aug 13, 2024
486c828
Merge branch 'main' into assistant_package_cleanup
elasticmachine Aug 13, 2024
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

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { Dispatch, SetStateAction } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui';
import { css } from '@emotion/react';
import { PromptResponse } from '@kbn/elastic-assistant-common';
import { QueryObserverResult } from '@tanstack/react-query';
import { Conversation } from '../../..';
import { AssistantAnimatedIcon } from '../assistant_animated_icon';
import { SystemPrompt } from '../prompt_editor/system_prompt';
import { SetupKnowledgeBaseButton } from '../../knowledge_base/setup_knowledge_base_button';
import * as i18n from '../translations';

interface Props {
currentConversation: Conversation | undefined;
currentSystemPromptId: string | undefined;
isSettingsModalVisible: boolean;
refetchCurrentUserConversations: () => Promise<
QueryObserverResult<Record<string, Conversation>, unknown>
>;
setIsSettingsModalVisible: Dispatch<SetStateAction<boolean>>;
setCurrentSystemPromptId: Dispatch<SetStateAction<string | undefined>>;
allSystemPrompts: PromptResponse[];
}

export const EmptyConvo: React.FC<Props> = ({
allSystemPrompts,
currentConversation,
currentSystemPromptId,
isSettingsModalVisible,
refetchCurrentUserConversations,
setCurrentSystemPromptId,
setIsSettingsModalVisible,
}) => {
return (
<EuiFlexGroup alignItems="center" justifyContent="center">
<EuiFlexItem grow={false}>
<EuiPanel
hasShadow={false}
css={css`
max-width: 400px;
text-align: center;
`}
>
<EuiFlexGroup alignItems="center" justifyContent="center" direction="column">
<EuiFlexItem grow={false}>
<AssistantAnimatedIcon />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText>
<h3>{i18n.EMPTY_SCREEN_TITLE}</h3>
<p>{i18n.EMPTY_SCREEN_DESCRIPTION}</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<SystemPrompt
conversation={currentConversation}
currentSystemPromptId={currentSystemPromptId}
onSystemPromptSelectionChange={setCurrentSystemPromptId}
isSettingsModalVisible={isSettingsModalVisible}
setIsSettingsModalVisible={setIsSettingsModalVisible}
allSystemPrompts={allSystemPrompts}
refetchConversations={refetchCurrentUserConversations}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<SetupKnowledgeBaseButton />
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
);
};
Loading