import { ContentProps } from "@/validations/mutual/dashboard/props";
import superUserBuildingPartsTenantSomething from "./building/parts/tenantSomething/page";

function getPageComponent(
  baseUrl: string,
  pageKey: string
): React.FC<ContentProps> | null {
  const pageGroup = pageIndexMulti[baseUrl];
  if (!pageGroup) {
    console.log(`No page group found for URL: ${baseUrl}`);
    return null;
  }

  const PageComponent = pageGroup[pageKey];
  if (!PageComponent) {
    console.log(
      `No page component found for key: ${pageKey} in URL group: ${baseUrl}`
    );
    return null;
  }

  return PageComponent;
}

const pageIndexMulti: Record<string, Record<string, React.FC<ContentProps>>> = {
  // New pages
  "/dashboard": {
    superUserBuildingPartsTenantSomething,
  },
  "/individual": {
    superUserBuildingPartsTenantSomething,
  },
  "/user": {
    superUserBuildingPartsTenantSomething,
  },
  "/build": {
    superUserBuildingPartsTenantSomething,
  },
  "/build/parts": {
    superUserBuildingPartsTenantSomething,
  },
  "/management/budget/actions": {
    superUserBuildingPartsTenantSomething,
  },
  "/management/budget": {
    superUserBuildingPartsTenantSomething,
  },
  "/annual/meeting/close": {
    superUserBuildingPartsTenantSomething,
  },
  "/emergency/meeting": {
    superUserBuildingPartsTenantSomething,
  },
  "/emergency/meeting/close": {
    superUserBuildingPartsTenantSomething,
  },
  "/tenant/accounting": {
    superUserBuildingPartsTenantSomething,
  },
  "/meeting/participation": {
    superUserBuildingPartsTenantSomething,
  },
  "/tenant/messageToBM": {
    superUserBuildingPartsTenantSomething,
  },
  "/tenant/messageToOwner": {
    superUserBuildingPartsTenantSomething,
  },
  "/management/accounting": {
    superUserBuildingPartsTenantSomething,
  },
  "/build/area": {
    superUserBuildingPartsTenantSomething,
  },
  "/management/budget/status": {
    superUserBuildingPartsTenantSomething,
  },

  // Early pages
  "/main/pages/user/dashboard": {
    superUserBuildingPartsTenantSomething,
  },
  "/definitions/identifications/people": {
    superUserBuildingPartsTenantSomething,
  },
  "/definitions/identifications/users": {
    superUserBuildingPartsTenantSomething,
  },
  "/definitions/building/parts": { superUserBuildingPartsTenantSomething },
  "/definitions/building/areas": { superUserBuildingPartsTenantSomething },
  "/building/accounts/managment/accounts": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/accounts/managment/budgets": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/accounts/parts/accounts": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/accounts/parts/budgets": { superUserBuildingPartsTenantSomething },
  "/building/meetings/regular/actions": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/meetings/regular/accounts": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/meetings/ergunt/actions": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/meetings/ergunt/accounts": {
    superUserBuildingPartsTenantSomething,
  },
  "/building/meetings/invited/attendance": {
    superUserBuildingPartsTenantSomething,
  },
};

export default pageIndexMulti;
