import { Preview, setup } from "@storybook/vue3";
import { createI18n } from "vue-i18n";
import de from "../src/locales/de.json";
import "../tailwind.css";
import { withVueRouter } from "./mockRouter";

setup((app) => {
  const i18n = createI18n({
    locale: "de", // set locale
    messages: { de },
  });
  withVueRouter(app);
  app.use(i18n);
});

const preview: Preview = {
  parameters: {
    actions: { argTypesRegex: "^on[A-Z].*" },
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/,
      },
    },
  },
};

export default preview;
