
function projects (state) {
  return state.projects;
}

function projectGroupNames (state) {
  return [...new Set(state.projects.map(i => i.groups).flat())].sort();
}

function projectCount (state) {
  return state.projects?.length ?? 0;
}

function projectsLoading (state) {
  return !!state.loading;
}

function groups (state) {
  return state.groups;
}

export default { projects, projectGroupNames, projectCount, projectsLoading, groups };
