import dayjs from "dayjs";

export const RANGE_DAYS = [7, 30, 90] as const;
export const TOP_ITEMS_LIMIT_OPTIONS = [10, 20, 50, 100] as const;
export const ITEM_CODE_DEBOUNCE_MS = 400;
export const DEFAULT_RANGE_DAYS = 7;

export function toDateRange(rangeDays: number) {
  const end = dayjs().format("YYYY-MM-DD");
  const start = dayjs().subtract(rangeDays, "day").format("YYYY-MM-DD");
  return { startDate: start, endDate: end };
}
