import { FIRST_URL } from '../shared'

export const MAX_HISTORY = 6

export const DEFAULT_HISTORY = [
  FIRST_URL,
  'https://nav.al/david-deutsch',
  'https://plausible.io'
]

export const addToHistory = (history, url) => {
  const filtered = history.filter(u => u !== url)
  return [url, ...filtered].slice(0, MAX_HISTORY)
}
