"use client";
import SiteBreadcrumb from "@/components/site-breadcrumb";
import ListViewTable from "@/components/table/task-plan/list-view-table";
import SingleViewTable from "@/components/table/task-plan/single-view-table";
import { Button } from "@/components/ui/button";
import { useRouter } from "@/i18n/routing";
import { useState } from "react";

export default function TaskPlanMediaHub() {
  const router = useRouter();
  const [view, setView] = useState("single");
  return (
    <>
      <SiteBreadcrumb />
      <div className="flex flex-col gap-4">
        <div className="flex justify-between">
          <Button
            onClick={() =>
              view === "single" ? setView("list") : setView("single")
            }
          >
            {view == "single" ? "List" : "Single"} View
          </Button>
          <Button
            color="primary"
            onClick={() =>
              router.push("/curator/task-plan/mediahub/create-monthly")
            }
          >
            Buat Perencaan
          </Button>
        </div>
        {view == "single" ? <SingleViewTable /> : <ListViewTable />}
      </div>
    </>
  );
}
