import { useState } from "react";
import { Grid } from "../components/Grid/Grid";
import Tabs from "../components/Tab/Tab";
import Taggings from "../partials/tagging/Taggings";
import Tags from "../partials/tagging/Tags";

const tabItems = [
  { label: "ثبت پلاک" },
  { label: "پلاک ها", page: "tagging_detail", access: "Show-Tagging-Detail" },
];

export default function Tagging() {
  const [selectedTab, setSelectedTab] = useState<number>(0);
  const handleTabChange = (index: number) => {
    setSelectedTab(index);
  };

  return (
    <Grid container column className="justify-center mt-2">
      <Tabs tabs={tabItems} onChange={handleTabChange} size="medium" />
      <Grid container column className="mt-2">
        {selectedTab === 0 && <Taggings />}
        {selectedTab === 1 && <Tags />}
      </Grid>
    </Grid>
  );
}
