Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

690 B
Raw Blame
import type { ComponentType } from "react";

// To run initialization side effects like Mantine styles, dayjs plugins, etc
import "embedding-sdk-bundle";
import { ComponentProvider } from "embedding-sdk-bundle/components/public/ComponentProvider";
import type { MetabaseAuthConfig } from "embedding-sdk-bundle/types";
import { STORYBOOK_METABASE_INSTANCE_URL } from "embedding-sdk-shared/test/storybook-constants";

const DEFAULT_AUTH_CONFIG: MetabaseAuthConfig = {
  metabaseInstanceUrl: STORYBOOK_METABASE_INSTANCE_URL,
};

export const CommonSdkStoryCorsWrapper = (Story: ComponentType) => (
  <ComponentProvider authConfig={DEFAULT_AUTH_CONFIG}>
    <Story />
  </ComponentProvider>
);