-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* change to see details and add stories to EstimationCard * fix * fix
- Loading branch information
1 parent
c23e04d
commit 32814d2
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
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
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,47 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { I18nextProvider } from 'react-i18next'; | ||
import i18n from 'translation/i18n'; | ||
|
||
import EstimationCard from './EstimationCard'; | ||
|
||
const meta: Meta<typeof EstimationCard> = { | ||
title: 'EstimationCard', | ||
component: EstimationCard, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof EstimationCard>; | ||
const instance: { message: string; issue: string } = { | ||
message: 'Some outage message.', | ||
issue: '5613', | ||
}; | ||
const queryClient = new QueryClient(); | ||
|
||
export const All: Story = { | ||
render: () => ( | ||
<div className="space-y-2"> | ||
<I18nextProvider i18n={i18n}> | ||
<QueryClientProvider client={queryClient}> | ||
<EstimationCard cardType="outage" outageMessage={instance} /> | ||
|
||
<EstimationCard cardType="estimated" outageMessage={instance} /> | ||
|
||
<EstimationCard | ||
cardType="estimated" | ||
outageMessage={instance} | ||
estimationMethod="estimated_mode_breakdown" | ||
/> | ||
|
||
<EstimationCard | ||
cardType="aggregated" | ||
outageMessage={instance} | ||
estimatedPercentage={20} | ||
/> | ||
|
||
<EstimationCard cardType="aggregated" outageMessage={instance} /> | ||
</QueryClientProvider> | ||
</I18nextProvider> | ||
</div> | ||
), | ||
}; |
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