import { Welcome, createBoltClient } from "@rapid-web/react";
import { routes, Handlers } from "../pages/api/bindings";

const bolt = createBoltClient<Handlers, typeof routes>(routes, {
  transport: "http://localhost:8080",
});

export default async function Home() {
  const { data: title } = await bolt("hello").get(routes.hello);

  return (
    <main>
      <Welcome>
        <p className="mt-4">{title}</p>
      </Welcome>
    </main>
  );
}
