Skip to content
Open
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
4 changes: 2 additions & 2 deletions cypress/e2e/chat_profiles/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
cl.Starter(
label="Say hi",
message="Start a conversation with a greeting",
icon="https://picsum.photos/300",
icon="a-arrow-down",
),
cl.Starter(
label="Ask for help",
message="Ask for help with something",
icon="https://picsum.photos/350",
icon="a-arrow-down",
),
]

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/config_overrides/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
cl.Starter(
label="Default Chat",
message="Start a conversation with default settings",
icon="https://picsum.photos/300",
icon="a-arrow-down",
),
cl.Starter(
label="MCP Test",
message="Test MCP functionality",
icon="https://picsum.photos/350",
icon="a-arrow-down",
),
]

Expand Down
17 changes: 6 additions & 11 deletions frontend/src/components/chat/Starter.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { useCallback, useContext } from 'react';
import { cn } from '@/lib/utils';
import { useCallback } from 'react';
import { useRecoilValue } from 'recoil';
import { v4 as uuidv4 } from 'uuid';

import {
ChainlitContext,
IStarter,
IStep,
useAuth,
useChatData,
useChatInteract
} from '@chainlit/react-client';

import Icon from '@/components/Icon';
import { Button } from '@/components/ui/button';

import { persistentCommandState } from '@/state/chat';
Expand All @@ -20,7 +21,6 @@ interface StarterProps {
}

export default function Starter({ starter }: StarterProps) {
const apiClient = useContext(ChainlitContext);
const selectedCommand = useRecoilValue(persistentCommandState);
const { sendMessage } = useChatInteract();
const { loading, connected } = useChatData();
Expand Down Expand Up @@ -53,14 +53,9 @@ export default function Starter({ starter }: StarterProps) {
>
<div className="flex gap-2">
{starter.icon ? (
<img
className="h-5 w-5 rounded-md"
src={
starter.icon?.startsWith('/public')
? apiClient.buildEndpoint(starter.icon)
: starter.icon
}
alt={starter.label}
<Icon
name={starter.icon}
className={cn('!h-5 !w-5 text-muted-foreground rounded-md')}
/>
) : null}
<p className="text-sm text-muted-foreground truncate">
Expand Down
Loading