gitscope
← marzneshin / v0.6.5 / dashboard/.storybook/preview.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/.storybook/preview.tsx · TypeScript
Blame Raw
 1import React from "react";
 2import type { Preview } from "@storybook/react";
 3import { TooltipProvider } from "../src/common/components";
 4import { ThemeProvider } from "../src/features/theme-switch";
 5import { queryClient } from "../src/common/utils";
 6import { QueryClientProvider } from "@tanstack/react-query";
 7import { I18nextProvider } from "react-i18next";
 8import { Title, Subtitle, Description, Primary, Controls, Stories } from '@storybook/blocks';
 9import i18n from "../src/features/i18n";
10
11import "./../src/globals.css";
12
13const preview: Preview = {
14    decorators: [
15        (Story) => (
16            <QueryClientProvider client={queryClient}>
17                <ThemeProvider defaultTheme="light" storageKey="ui-theme">
18                    <TooltipProvider>
19                        <I18nextProvider i18n={i18n}>
20                            <Story />
21                        </I18nextProvider>
22                    </TooltipProvider>
23                </ThemeProvider>
24            </QueryClientProvider>
25        ),
26    ],
27    parameters: {
28        controls: {
29            matchers: {
30                color: /(background|color)$/i,
31                date: /Date$/i,
32            },
33        },
34        docs: {
35            page: () => (
36                <>
37                    <Title />
38                    <Subtitle />
39                    <Description />
40                    <Primary />
41                    <Controls />
42                    <Stories />
43                </>
44            ),
45        },
46    },
47}
48
49export default preview;