/**
 * 营业时间页面常量集合：
 * - 星期维度
 * - 颜色与文案映射
 * - 下拉选项
 */
import type { DayName, SlotTypeOption } from '../../types';

import { HolidayType, SlotType } from '#/api/store-hours';

export const DAY_NAMES: DayName[] = [
  { label: '周一', labelEn: 'Monday' },
  { label: '周二', labelEn: 'Tuesday' },
  { label: '周三', labelEn: 'Wednesday' },
  { label: '周四', labelEn: 'Thursday' },
  { label: '周五', labelEn: 'Friday' },
  { label: '周六', labelEn: 'Saturday' },
  { label: '周日', labelEn: 'Sunday' },
];

export const DEFAULT_DAY_NAME: DayName = {
  label: '周一',
  labelEn: 'Monday',
};

export const DAY_INDEXES = [0, 1, 2, 3, 4, 5, 6] as const;

export const SLOT_COLORS: Record<
  number,
  { bg: string; border: string; dot: string; text: string }
> = {
  [SlotType.Business]: {
    bg: '#f6ffed',
    border: '#b7eb8f',
    dot: '#b7eb8f',
    text: '#389e0d',
  },
  [SlotType.Delivery]: {
    bg: '#e6f7ff',
    border: '#91d5ff',
    dot: '#91d5ff',
    text: '#1890ff',
  },
  [SlotType.Pickup]: {
    bg: '#fff7e6',
    border: '#ffd591',
    dot: '#ffd591',
    text: '#d46b08',
  },
};

export const HOLIDAY_COLORS: Record<number, { bg: string; text: string }> = {
  [HolidayType.Closed]: { bg: '#fff2f0', text: '#ef4444' },
  [HolidayType.Special]: { bg: '#fff7e6', text: '#f59e0b' },
};

export const DEFAULT_SLOT_COLOR = {
  bg: '#f6ffed',
  border: '#b7eb8f',
  dot: '#b7eb8f',
  text: '#389e0d',
};

export const DEFAULT_HOLIDAY_COLOR = {
  bg: '#fff2f0',
  text: '#ef4444',
};

export const SLOT_TYPE_LABELS: Record<number, string> = {
  [SlotType.Business]: '营业',
  [SlotType.Delivery]: '配送',
  [SlotType.Pickup]: '自提',
};

export const SLOT_TYPE_OPTIONS: SlotTypeOption[] = [
  { label: '营业', value: SlotType.Business },
  { label: '配送', value: SlotType.Delivery },
  { label: '自提', value: SlotType.Pickup },
];
