-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0a6e54
commit d787b53
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
apps/nextjs/src/components/AppComponents/Chat/header.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { DemoContext } from "@/components/ContextProviders/Demo"; | ||
|
||
import { Header } from "./header"; | ||
|
||
const DemoDecorator: Story["decorators"] = (Story, { parameters }) => ( | ||
<DemoContext.Provider | ||
value={{ | ||
isDemoUser: false, | ||
isSharingEnabled: true, | ||
...parameters.demoContext, | ||
}} | ||
> | ||
<Story /> | ||
</DemoContext.Provider> | ||
); | ||
|
||
const meta: Meta<typeof Header> = { | ||
title: "Components/Layout/ChatHeader", | ||
component: Header, | ||
tags: ["autodocs"], | ||
decorators: [DemoDecorator], | ||
parameters: { | ||
layout: "fullscreen", | ||
docs: { | ||
story: { | ||
height: "150px", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Header>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const DemoUser: Story = { | ||
args: {}, | ||
parameters: { | ||
demoContext: { | ||
isDemoUser: true, | ||
appSessionsPerMonth: 3, | ||
appSessionsRemaining: 2, | ||
}, | ||
}, | ||
}; | ||
|
||
export const DemoLoading: Story = { | ||
args: {}, | ||
parameters: { | ||
demoContext: { | ||
isDemoUser: true, | ||
appSessionsPerMonth: 3, | ||
appSessionsRemaining: undefined, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters