import { Component, splitProps } from "solid-js";
import QrCode from "./QrCode";

const SwissQrCode: Component<Parameters<typeof QrCode>[0]> = (p) => {
  const [props, rest] = splitProps(p, ["class"]);

  return (
    <div class={"relative " + props.class}>
      <div class="absolute flex w-full h-full justify-center items-center">
        <img
          alt="Flag of Switzerland"
          src="swiss-cross/CH-Kreuz_Freiheit_7mm.svg"
          class="w-[15%] h-[15%]"
        />
      </div>
      <QrCode
        class="w-full h-full"
        margin={0}
        errorCorrectionLevel="M"
        {...rest}
      />
    </div>
  );
};

export default SwissQrCode;
