import { Grid } from "../components/Grid/Grid";
import { useState } from "react";
import Tabs from "../components/Tab/Tab";
import { OrganizationsList } from "../partials/management/OrganizationsList";
import { OrganizationsTypes } from "../partials/management/OrganizationsTypes";

export default function Organizations() {
  const tabItems = [
    {
      label: "نهاد",
      page: "organizations",
      access: "Show-Organization-Type",
    },
    { label: "سازمان ها" },
  ];

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

  return (
    <Grid container column className="gap-2">
      <Tabs tabs={tabItems} onChange={handleTabChange} size="medium" />
      {selectedTab === 0 ? <OrganizationsTypes /> : <OrganizationsList />}
    </Grid>
  );
}
