"use client";

import { useEffect } from "react";

export default function UAData({
  titleAMD64,
  titleARM64,
}: {
  titleAMD64: string;
  titleARM64: string;
}) {
  useEffect(() => {
    (async () => {
      const { architecture } =
        await window.navigator.userAgentData.getHighEntropyValues([
          "architecture",
        ]);
      switch (architecture) {
        case "arm":
          window.location.href = `/qwilight/${titleARM64}`;
          break;
        case "x86":
          window.location.href = `/qwilight/${titleAMD64}`;
          break;
      }
    })();
  }, [titleAMD64, titleARM64]);

  return null;
}
