import { Rect, version as fabricVersion } from "fabric";
import { renderToStaticMarkup } from "react-dom/server";

export function ToolchainProbe() {
  return <canvas aria-label="Dada toolchain probe" height={16} width={16} />;
}

export function renderToolchainProbe() {
  const reactMarkup = renderToStaticMarkup(<ToolchainProbe />);
  const fabricSvg = new Rect({
    fill: "#111111",
    height: 16,
    width: 16,
  }).toSVG();

  return {
    fabricSvg,
    fabricVersion,
    reactMarkup,
  };
}
