diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx
index b6fbaea530..4e9950b676 100644
--- a/client/src/components/Chat/ChatView.tsx
+++ b/client/src/components/Chat/ChatView.tsx
@@ -13,6 +13,7 @@ import ConversationStarters from './Input/ConversationStarters';
import MessagesView from './Messages/MessagesView';
import Presentation from './Presentation';
import ChatForm from './Input/ChatForm';
+import CostBar from './CostBar';
import Landing from './Landing';
import Header from './Header';
import Footer from './Footer';
@@ -116,59 +117,7 @@ function ChatView({ index = 0 }: { index?: number }) {
!isLandingPage &&
conversationCosts &&
conversationCosts.totals && (
-
-
-
-
-
- {conversationCosts.totals.prompt.tokenCount}t
-
-
${Math.abs(conversationCosts.totals.prompt.usd).toFixed(6)}
-
-
-
{conversationCosts.totals.total.tokenCount}t
-
${Math.abs(conversationCosts.totals.total.usd).toFixed(6)}
-
-
-
-
- {conversationCosts.totals.completion.tokenCount}t
-
-
${Math.abs(conversationCosts.totals.completion.usd).toFixed(6)}
-
-
-
+
)
}
costs={conversationCosts}
diff --git a/client/src/components/Chat/CostBar.tsx b/client/src/components/Chat/CostBar.tsx
new file mode 100644
index 0000000000..d450114842
--- /dev/null
+++ b/client/src/components/Chat/CostBar.tsx
@@ -0,0 +1,69 @@
+import type { TConversationCosts } from 'librechat-data-provider';
+import { cn } from '~/utils';
+
+interface CostBarProps {
+ conversationCosts: TConversationCosts;
+ showCostBar: boolean;
+}
+
+export default function CostBar({ conversationCosts, showCostBar }: CostBarProps) {
+ if (!conversationCosts || !conversationCosts.totals) {
+ return null;
+ }
+
+ return (
+
+
+
+
+
+ {conversationCosts.totals.prompt.tokenCount}t
+
+
${Math.abs(conversationCosts.totals.prompt.usd).toFixed(6)}
+
+
+
{conversationCosts.totals.total.tokenCount}t
+
${Math.abs(conversationCosts.totals.total.usd).toFixed(6)}
+
+
+
+
+ {conversationCosts.totals.completion.tokenCount}t
+
+
${Math.abs(conversationCosts.totals.completion.usd).toFixed(6)}
+
+
+
+ );
+}