-
Notifications
You must be signed in to change notification settings - Fork 307
Expand file tree
/
Copy pathUsageCounter.stories.tsx
More file actions
57 lines (50 loc) · 1.3 KB
/
UsageCounter.stories.tsx
File metadata and controls
57 lines (50 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from "react";
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 ".";
import { Usage } from "../../../services/refact";
import {
USAGE_COUNTER_STUB_ANTHROPIC,
USAGE_COUNTER_STUB_GPT,
} from "./UsageCounter.fixtures";
const MockedStore: React.FC<{ usage: Usage }> = ({ usage }) => {
const store = setUpStore({
config: {
themeProps: {
appearance: "dark",
},
host: "web",
lspPort: 8001,
},
});
return (
<Provider store={store}>
<AbortControllerProvider>
<Theme accentColor="gray">
<UsageCounter usage={usage} />
</Theme>
</AbortControllerProvider>
</Provider>
);
};
const meta: Meta<typeof MockedStore> = {
title: "UsageCounter",
component: MockedStore,
args: {
usage: USAGE_COUNTER_STUB_GPT,
},
};
export default meta;
export const GPTUsageCounter: StoryObj<typeof UsageCounter> = {
args: {
usage: USAGE_COUNTER_STUB_GPT,
},
};
export const AnthropicUsageCounter: StoryObj<typeof UsageCounter> = {
args: {
usage: USAGE_COUNTER_STUB_ANTHROPIC,
},
};