export type Language = {
  code: string;
  name: string;
  is_active: boolean;
  is_default?: boolean;
};

export type Column = {
  key: string;
  label: string;
  sortable: boolean;
  searchable: boolean;
  component: string | null;
  hidden: boolean;
  badges: Record<string, { label: string; color: string }> | null;
};

export type Filter = {
  key: string;
  label: string;
  type: string;
  options: Record<string, string> | null;
};

export type PaginationLink = {
  url: string | null;
  label: string;
  active: boolean;
};

export type Paginator = {
  data: Record<string, unknown>[];
  links: PaginationLink[];
  current_page: number;
  last_page: number;
  total: number;
  from: number | null;
  to: number | null;
  per_page: number;
};

export type BulkAction = {
  key: string;
  label: string;
  icon: string | null;
  confirm: string | null;
  permission: string | null;
};

export type RowAction = {
  key: string;
  label: string;
  icon: string | null;
  url: string | null;
  method: "get" | "post";
  destructive: boolean;
  confirm: { title: string; message: string } | null;
};

export type ResourceDefinition = {
  slug: string;
  label: string;
  singularLabel: string;
  sections: {
    fields: import("../components/fields/types").FieldDefinition[];
  }[];
  columns: Column[];
  filters: Filter[];
  bulkActions: BulkAction[];
  hasCustomRowActions: boolean;
  actionPermissions: Record<string, string | null>;
  showTimestamps: boolean;
  isHierarchical: boolean;
  isPublic: boolean;
  publicUrlBase: string;
};
