Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/remove-empty-chat-settings'…
Browse files Browse the repository at this point in the history
… into feat/remove-empty-chat-settings
  • Loading branch information
irinakartun committed Jun 26, 2024
2 parents 603ea1b + 03d7c81 commit da27056
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/chat/src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ export const ChatView = memo(() => {
)}
>
<EmptyChatDescription
conv={conv}
appName={appName}
modelsLoaded={models.length !== 0}
/>
Expand Down
17 changes: 12 additions & 5 deletions apps/chat/src/components/Chat/EmptyChatDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
import classNames from 'classnames';

import { ConversationsSelectors } from '@/src/store/conversations/conversations.reducers';
import { Conversation } from '@/src/types/chat';

import { useAppSelector } from '@/src/store/hooks';
import { ModelsSelectors } from '@/src/store/models/models.reducers';

import { Spinner } from '../Common/Spinner';
import { ModelDescription } from './ModelDescription';

interface Props {
conv: Conversation;
modelsLoaded: boolean;
appName: string;
}

export const EmptyChatDescription = ({ modelsLoaded, appName }: Props) => {
const model = useAppSelector(
ConversationsSelectors.selectSelectedConversationsModels,
)[0];
export const EmptyChatDescription = ({
conv,
modelsLoaded,
appName,
}: Props) => {
const model = useAppSelector((state) =>
ModelsSelectors.selectModel(state, conv.model.id),
);
const Tag = model ? 'div' : 'h4';
const showAppName = !model;

Expand Down

0 comments on commit da27056

Please sign in to comment.