"use client";
import { AddIcon } from "@/components/icons";
import ArticleTable from "@/components/table/article-table";
import MagazineTable from "@/components/table/magazine/magazine-table";
import generatedArticleIds from "@/store/generated-article-store";
import { Button, Card } from "@nextui-org/react";
import Link from "next/link";
import { useRouter } from "next/navigation";

export default function MagazineTablePage() {
  const router = useRouter();
  const setGeneratedArticleIdStore = generatedArticleIds(
    (state) => state.setArticleIds
  );

  return (
    <div className="overflow-x-hidden overflow-y-scroll">
      <div className="px-2 md:px-4 w-full">
        <div className="rounded-md my-5 px-5 py-2 shadow-lg bg-white dark:bg-[#18181b] flex flex-row gap-3">
          <Link href="/admin/magazine/create">
            <Button size="md" className="bg-[#F07C00] text-white">
              Tambah Majalah
              <AddIcon />
            </Button>
          </Link>
          {/* <Button
            size="md"
            color="primary"
            className="bg-[#F07C00] text-white"
            onPress={goGenerate}
          >
            <AddIcon />
            Generate Article
          </Button> */}
        </div>
        <div className="bg-white shadow-lg dark:bg-[#18181b] rounded-xl p-2">
          <MagazineTable />
        </div>
      </div>
    </div>
  );
}
