import type { UserSettings } from '@/lib/user-settings'

interface StateLike {
  entities: { settings: UserSettings }
  context: { hydrated: boolean; isDemo: boolean }
}

export const selectSprintBacklogPrefs = (s: StateLike) =>
  s.entities.settings.views?.sprintBacklog ?? {}

export const selectPbiListPrefs = (s: StateLike) =>
  s.entities.settings.views?.pbiList ?? {}

export const selectStoryPanelPrefs = (s: StateLike) =>
  s.entities.settings.views?.storyPanel ?? {}

export const selectJobsColumnPrefs = (key: string) => (s: StateLike) =>
  s.entities.settings.views?.jobsColumns?.[key] ?? { kinds: [], statuses: [] }

export const selectDevToolsPrefs = (s: StateLike) =>
  s.entities.settings.devTools ?? {}

export const selectHydrated = (s: StateLike) => s.context.hydrated
