import type { Resource } from "@nexus/shared";
import { ResourceType } from "@nexus/shared";

export type ModalState =
  | { type: "closed" }
  | { type: "create" }
  | { type: "edit"; resource: Resource }
  | { type: "import" }
  | { type: "bulkEdit" };

export type ConfirmState =
  | { type: "closed" }
  | { type: "batchDeactivate"; ids: string[] }
  | { type: "deactivate"; resource: Resource }
  | { type: "delete"; resource: Resource }
  | { type: "batchDelete"; ids: string[] };

export type ActiveFilter = "active" | "inactive" | "all";
export type BooleanFilter = "all" | "yes" | "no";
export type ResourceListPage = {
  resources: Resource[];
  total: number;
  nextCursor?: string | null;
};

export type CountryOption = {
  id: string;
  name: string;
};

export const DEFAULT_HIDDEN_RESOURCE_TYPES = [ResourceType.FREELANCER] as const;
export const DEFAULT_BOOLEAN_FILTER: BooleanFilter = "no";

export const RESOURCE_TYPE_LABELS: Record<ResourceType, string> = {
  [ResourceType.EMPLOYEE]: "Employee",
  [ResourceType.FREELANCER]: "Freelancer",
  [ResourceType.APPRENTICE]: "Apprentice",
  [ResourceType.INTERN]: "Intern",
  [ResourceType.STUDENT]: "Student",
};
