import type { ReactNode } from "react";
import "../styles/global.css";
import Providers from "../components/Providers.js";

const Layout = ({ children }: { children: ReactNode }) => (
  <Providers>
    <div className="min-h-screen bg-gray-50 text-gray-900">
      <header className="border-b border-gray-200 bg-white px-4 py-3">
        <h1 className="text-xl font-bold">
          <a href="/" className="hover:text-blue-600">
            P2P Poll
          </a>
        </h1>
      </header>
      <main className="mx-auto max-w-xl px-4 py-8">{children}</main>
    </div>
  </Providers>
);

export default Layout;

export const getConfig = async () => {
  return { render: "static" } as const;
};
