"use client";
import SiteBreadcrumb from "@/components/site-breadcrumb";
import ContentListTable from "./component/table";
import { useState } from "react";

import BannerListTable from "./component/banner-table";
import { Button } from "@/components/ui/button";

export default function AdminBanner() {
  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"
            ? "Daftar List Media"
            : "Table List Banner"}

          <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 "
                }`}
            >
              Kontent
            </Button>
            <Button
              rounded="md"
              onClick={() => setSelectedTab("banner")}
              className={` hover:text-white
                ${
                  selectedTab === "banner"
                    ? "bg-black text-white "
                    : "bg-white text-black "
                }`}
            >
              Banner
            </Button>
          </div>
        </div>

        {selectedTab === "content" ? <ContentListTable /> : <BannerListTable />}
      </div>
    </div>
  );
}
