diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx index 4e4358170..34882eec6 100644 --- a/app/components/chat-list.tsx +++ b/app/components/chat-list.tsx @@ -21,14 +21,39 @@ export function ChatItem(props: { time: string; selected: boolean; }) { - return ( + const [sidebarCollapse] = useChatStore((state) => [state.sidebarCollapse]); + return sidebarCollapse ? ( +
+
+ {Locale.ChatItem.ChatItemCount(props.count).replace(/[^0-9]/g, "") + .length <= 3 + ? Locale.ChatItem.ChatItemCount(props.count).replace(/[^0-9]/g, "") + : ":)"} +
+
+ +
+
+ ) : (
-
{props.title}
+
{props.title}
{Locale.ChatItem.ChatItemCount(props.count)} diff --git a/app/components/home.tsx b/app/components/home.tsx index 1295ea443..631fd7918 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -58,60 +58,6 @@ export function Avatar(props: { role: Message["role"] }) { ); } -export function ChatItem(props: { - onClick?: () => void; - onDelete?: () => void; - title: string; - count: number; - time: string; - selected: boolean; -}) { - const [sidebarCollapse] = useChatStore((state) => [state.sidebarCollapse]); - return sidebarCollapse ? ( -
-
- {Locale.ChatItem.ChatItemCount(props.count).replace(/[^0-9]/g, "") - .length <= 3 - ? Locale.ChatItem.ChatItemCount(props.count).replace(/[^0-9]/g, "") - : ":)"} -
-
- -
-
- ) : ( -
-
{props.title}
-
-
- {Locale.ChatItem.ChatItemCount(props.count)} -
-
{props.time}
-
-
- -
-
- ); -} - function useSubmitHandler() { const config = useChatStore((state) => state.config); const submitKey = config.submitKey;