"use client";
import SiteBreadcrumb from "@/components/site-breadcrumb";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import ContentListTable from "../banner/component/table";
import BannerListTable from "../banner/component/banner-table";
import PopUpList from "./component/table";
import PopUpListTable from "./component/popup-table";

export default function AdminPopup() {
  const [selectedTab, setSelectedTab] = useState("content");

  return (
    <div>
      <SiteBreadcrumb />
      <div className="w-full overflow-x-auto bg-white p-4 rounded-sm space-y-3">
        <div className="flex justify-between">
          {selectedTab === "content" ? "List Media" : " List Pop Up"}

          <div className="flex flex-row gap-1 border-2 rounded-md w-fit mb-5">
            <Button
              rounded="md"
              onClick={() => setSelectedTab("content")}
              className={` hover:text-white
                ${
                  selectedTab === "content"
                    ? "bg-black text-white "
                    : "bg-white text-black "
                }`}
            >
              Konten
            </Button>
            <Button
              rounded="md"
              onClick={() => setSelectedTab("popup")}
              className={` hover:text-white
                ${
                  selectedTab === "popup"
                    ? "bg-black text-white "
                    : "bg-white text-black "
                }`}
            >
              Pop Up
            </Button>
          </div>
        </div>

        {selectedTab === "content" ? <PopUpList /> : <PopUpListTable />}
      </div>
    </div>
  );
}
