import React from "react";
import { Box } from "@mui/material";
import { useNavigate } from "react-router-dom";
import Intro from "../components/Intro";
import BenchmarkCreateForm from "../components/BenchmarkCreateForm";

function HomePage() {
  const navigate = useNavigate();

  const handleStartGeneration = (sid, isDefaultDocument) => {
    navigate(
      `/benchmark-generation?session=${sid}&isDefault=${
        isDefaultDocument ? "true" : "false"
      }`
    );
  };

  return (
    <>
      <Intro />
      <Box
        sx={{
          border: "1px solid rgba(0, 0, 0, 0.12)",
          borderRadius: 2,
          p: 4,
          bgcolor: "white",
        }}
      >
        <BenchmarkCreateForm onStartGeneration={handleStartGeneration} />
      </Box>
    </>
  );
}

export default HomePage;
