diff --git a/packages/web/src/components/ChatList.tsx b/packages/web/src/components/ChatList.tsx index 29bd00df..69674890 100644 --- a/packages/web/src/components/ChatList.tsx +++ b/packages/web/src/components/ChatList.tsx @@ -4,11 +4,9 @@ import useChatList from '../hooks/useChatList'; import { useNavigate, useParams } from 'react-router-dom'; import ChatListItem from './ChatListItem'; import { decomposeId } from '../utils/ChatUtils'; -import { ROUTE_INDEX_USE_CASE_BUILDER } from '../main'; type Props = BaseProps & { searchWords: string[]; - isUseCaseBuilder?: boolean; }; const ChatList: React.FC = (props) => { @@ -19,14 +17,12 @@ const ChatList: React.FC = (props) => { const onDelete = useCallback( (_chatId: string) => { - navigate(props.isUseCaseBuilder ? ROUTE_INDEX_USE_CASE_BUILDER : '/chat'); + navigate('/chat'); return deleteChat(_chatId).catch(() => { - navigate( - `${props.isUseCaseBuilder ? ROUTE_INDEX_USE_CASE_BUILDER : ''}/chat/${_chatId}` - ); + navigate(`/chat/${_chatId}`); }); }, - [deleteChat, navigate, props.isUseCaseBuilder] + [deleteChat, navigate] ); const onUpdateTitle = useCallback( @@ -66,7 +62,6 @@ const ChatList: React.FC = (props) => { onDelete={onDelete} onUpdateTitle={onUpdateTitle} highlightWords={props.searchWords} - isUseCaseBuilder={props.isUseCaseBuilder} /> ); })} diff --git a/packages/web/src/components/ChatListItem.tsx b/packages/web/src/components/ChatListItem.tsx index 94ae7f67..743e34cb 100644 --- a/packages/web/src/components/ChatListItem.tsx +++ b/packages/web/src/components/ChatListItem.tsx @@ -14,7 +14,6 @@ import { Chat } from 'generative-ai-use-cases-jp'; import { decomposeId } from '../utils/ChatUtils'; import DialogConfirmDeleteChat from './DialogConfirmDeleteChat'; import HighlightWithinTextarea from 'react-highlight-within-textarea'; -import { ROUTE_INDEX_USE_CASE_BUILDER } from '../main'; type Props = BaseProps & { active: boolean; @@ -24,7 +23,6 @@ type Props = BaseProps & { // eslint-disable-next-line @typescript-eslint/no-explicit-any onUpdateTitle: (chatId: string, title: string) => Promise; highlightWords: string[]; - isUseCaseBuilder?: boolean; }; const ChatListItem: React.FC = (props) => { @@ -107,7 +105,7 @@ const ChatListItem: React.FC = (props) => { props.active && 'bg-aws-sky' } ${props.className}`} - to={`${props.isUseCaseBuilder ? ROUTE_INDEX_USE_CASE_BUILDER : ''}/chat/${chatId}`}> + to={`/chat/${chatId}`}>