// The groups the top-bar search can return, in the order the dropdown shows
// them.
export const SEARCH_GROUPS = [
  'issues',
  'progressReports',
  'meetings',
  'plenary',
] as const;

export type SearchGroup = (typeof SEARCH_GROUPS)[number];

// One hit. `meta` carries the ids the UI needs to build a link for the role
// the reader is in; the API never guesses the route.
export type SearchResult = {
  group: SearchGroup;
  id: number;
  title: string;
  subtitle?: string;
  meta?: Record<string, string | number>;
};

export type SearchResponse = {
  query: string;
  results: SearchResult[];
};
