import { preloadAllTasks } from "@/app/api/tasks";
import CreateTaskTemplate from "@/components/CreateTaskTemplate";
import { getServerI18n } from "@/i18n";
import Typography from "@mui/material/Typography";
import { Metadata } from "next";
import { I18nProvider } from "@/i18n";

export const metadata: Metadata = {
  title: "Create Task Template",
};

const Projects: React.FC = async () => {
  const { t } = await getServerI18n("tasks");
  preloadAllTasks();

  return (
    <>
      <Typography variant="h4">{t("Create Task Template")}</Typography>
      <I18nProvider namespaces={["tasks", "common"]}>
        <CreateTaskTemplate />
      </I18nProvider>
    </>
  );
};

export default Projects;
