diff --git a/src/components/ChatContent/AssistantInput.tsx b/src/components/ChatContent/AssistantInput.tsx index 6456f4ae..797662d4 100644 --- a/src/components/ChatContent/AssistantInput.tsx +++ b/src/components/ChatContent/AssistantInput.tsx @@ -7,6 +7,7 @@ import { ToolContent } from "./ToolsContent"; import { fallbackCopying } from "../../utils/fallbackCopying"; import { telemetryApi } from "../../services/refact/telemetry"; import { LikeButton } from "./LikeButton"; +import { UsageCounter } from "./UsageCounter"; type ChatInputProps = { message: string | null; @@ -58,6 +59,7 @@ export const AssistantInput: React.FC = ({ return ( + {message && ( diff --git a/src/components/ChatContent/UsageCounter/UsageCounter.module.css b/src/components/ChatContent/UsageCounter/UsageCounter.module.css new file mode 100644 index 00000000..31abb3b6 --- /dev/null +++ b/src/components/ChatContent/UsageCounter/UsageCounter.module.css @@ -0,0 +1,11 @@ +.usageCounterContainer { + position: absolute; + top: 0; + right: 0; + display: flex; + align-items: center; + padding: var(--space-2) var(--space-3); + gap: 8px; + max-width: max-content; + opacity: 0.7; +} diff --git a/src/components/ChatContent/UsageCounter/UsageCounter.stories.tsx b/src/components/ChatContent/UsageCounter/UsageCounter.stories.tsx new file mode 100644 index 00000000..5dd16e52 --- /dev/null +++ b/src/components/ChatContent/UsageCounter/UsageCounter.stories.tsx @@ -0,0 +1,39 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { Provider } from "react-redux"; + +import { setUpStore } from "../../../app/store"; +import { Theme } from "../../Theme"; +import { AbortControllerProvider } from "../../../contexts/AbortControllers"; + +import { UsageCounter } from "."; + +const MockedStore: React.FC = () => { + const store = setUpStore({ + config: { + themeProps: { + appearance: "dark", + }, + host: "web", + lspPort: 8001, + }, + }); + + return ( + + + + + + + + ); +}; + +const meta: Meta = { + title: "UsageCounter", + component: MockedStore, +}; + +export default meta; + +export const Default: StoryObj = {}; diff --git a/src/components/ChatContent/UsageCounter/UsageCounter.tsx b/src/components/ChatContent/UsageCounter/UsageCounter.tsx new file mode 100644 index 00000000..26f2daec --- /dev/null +++ b/src/components/ChatContent/UsageCounter/UsageCounter.tsx @@ -0,0 +1,18 @@ +import { Card, Flex, Text } from "@radix-ui/themes"; +import styles from "./UsageCounter.module.css"; +import { ArrowDownIcon, ArrowUpIcon } from "@radix-ui/react-icons"; + +export const UsageCounter = () => { + return ( + + + + 1.2k + + + + 12k + + + ); +}; diff --git a/src/components/ChatContent/UsageCounter/index.ts b/src/components/ChatContent/UsageCounter/index.ts new file mode 100644 index 00000000..62f85dc9 --- /dev/null +++ b/src/components/ChatContent/UsageCounter/index.ts @@ -0,0 +1 @@ +export { UsageCounter } from "./UsageCounter";