// Function to update search params
export const getSearchParams = (newParams: Record<string, string | number>) => {
  const currentParams = new URLSearchParams(window.location.search)

  Object.entries(newParams).forEach(([key, value]) => {
    if (value === undefined || value === null) {
      currentParams.delete(key)
    } else {
      currentParams.set(key, String(value))
    }
  })

  return currentParams.toString()
}
