import { MantineThemeOverride } from "@mantine/core";
import {
  HyperlinkToolbar,
  HyperlinkToolbarDynamicParams,
  HyperlinkToolbarFactory,
  HyperlinkToolbarStaticParams,
} from "bocknoat-core";
import { ReactElementFactory } from "../ElementFactory/components/ReactElementFactory";
import { HyperlinkToolbar as ReactHyperlinkToolbar } from "./components/HyperlinkToolbar";

export const createReactHyperlinkToolbarFactory =
  (theme: MantineThemeOverride): HyperlinkToolbarFactory =>
  (staticParams): HyperlinkToolbar =>
    ReactElementFactory<
      HyperlinkToolbarStaticParams,
      HyperlinkToolbarDynamicParams
    >(staticParams, ReactHyperlinkToolbar, theme, {
      animation: "fade",
      placement: "top-start",
    });
