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: "Edit Task Template",
};

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

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

export default TaskTemplates;
