import type { ComponentType } from "react";
import type { MenuCode, PermissionCode } from "@/app/permissions";

export type RouteLoader = () => Promise<ComponentType<any>>;

export interface PublicRoute {
  label: string;
  loader: RouteLoader;
  pageKey: string;
  path: string;
}

export interface AdminRoute extends PublicRoute {
  menuCode: MenuCode;
  permission: PermissionCode;
  props?: Record<string, unknown>;
}

export interface NavItem {
  children?: NavItem[];
  code?: string;
  icon?: ComponentType<{ fontSize?: "inherit" | "large" | "medium" | "small" }>;
  id: string;
  label: string;
  path?: string;
  permissionCode?: PermissionCode | string;
}
