import type { ReactNode } from 'react';

export type PageMenuTreeNode = {
  title: ReactNode;
  value: string;
  key: string;
  children?: PageMenuTreeNode[];
};

export type ResourceDefinition = {
  id: number;
  code: string;
  name: string;
  description?: string;
  type?: string;
};

export type ResourcePermissionAction = {
  actionCode: string;
  displayName?: string;
};

export type PageResourceAssignment = {
  resourceId: number;
  resourceName: string;
  assignedPermissions: string[];
};

export type PageEntityData = {
  id: number;
  name: string;
  path?: string;
  parentId: number | null;
  description?: string;
  creator?: string;
  pageResources?: PageResourceAssignment[];
  createdAt?: Date;
  updatedAt?: Date;
};

export type PageResourcePermissionSummary = {
  resourceIds: number[];
  resourceNames: string[];
  allPermissionActions: string[];
};
