import type { ItemCoords } from '../types'

export const mapPartialCoords = (coords: Array<ItemCoords>) => (
  coords.map(({ width }) => ({ position: 0, width }))
)

export const mapPositionCoords = (coords: Array<ItemCoords>, position = 0) => coords.map((item) => {
  if (item.position > position) {
    return { ...item, position }
  }
  return item
})
