import type { Route } from "./+types/home";
import Test from "../pages/test";
import client from "~/api/client";
import type { Item } from "~/api/client";

export function meta({}: Route.MetaArgs) {
  return [
    { title: "Aindustries' casino" },
    { name: "description", content: "Welcome to React Router!" },
  ];
}

export async function clientLoader() {
  let item = await client.GET("/item", {
    query: { uuid: "eee91ea1-1827-482b-b298-63bd6eda0221" },
  });
  return item;
}

export default function TestPage({ loaderData: item }: { loaderData: Item }) {
  return <Test item={item} />;
}
