"use client";

import { deleteAllGameSystems } from "@/actions/GameSystems/devactions";
import { DevTool } from "@/components/devtools/DevTool";
import { useRouter } from "next/navigation";
import { FC, PropsWithChildren } from "react";

export const GameSystemsClient: FC<PropsWithChildren> = ({ children }) => {
  const router = useRouter();
  // DEV TOOL ONLY
  async function deleteAll() {
    await deleteAllGameSystems();
    router.refresh();
  }

  return (
    <>
      <DevTool id="game-system-home">
        <button onClick={deleteAll} className="btn-primary bg-lime-600">
          Delete All Game Systems
        </button>
      </DevTool>
      {children}
    </>
  );
};
