import { fetchTaskTemplates } from "@/app/api/tasks";
import React from "react";
import TaskTemplateSearch from "./TaskTemplateSearch";
import TaskTemplateSearchLoading from "./TaskTemplateSearchLoading";

interface SubComponents {
  Loading: typeof TaskTemplateSearchLoading;
}

const TaskTemplateSearchWrapper: React.FC & SubComponents = async () => {
  const taskTemplates = await fetchTaskTemplates();

  return <TaskTemplateSearch taskTemplates={taskTemplates} />;
};

TaskTemplateSearchWrapper.Loading = TaskTemplateSearchLoading;

export default TaskTemplateSearchWrapper;
