import type { RootState } from "./state"

export const getActiveFile = (state: RootState) =>
  state.tabs.find(file => file.id === state.activeFileId)

export const getActiveFileRules = (state: RootState) => getActiveFile(state)?.rules

export const getTabs = (state: RootState) => state.tabs

export const getTabFileIds = (state: RootState) => getTabs(state).map(tab => tab.id)
