// pages/index.js
import { fetchPageContent } from "../app/composables";
import { submitView  } from "../app/composables";

import MainClient from "./components/mainClient";

export async function getServerSideProps({ req }) {
  const ip =
  req.headers["x-forwarded-for"]?.split(",")[0] ||
  req.socket.remoteAddress ||
  "";

  const data = await fetchPageContent(ip);
  return data;
}


export default function Home({ data }) {
  return <MainClient data={data} />;
}


