import {
  type MoodDurationPreset,
  type MoodTemplateId,
} from 'src/types/userMood';

export type MoodTemplate = {
  id: MoodTemplateId;
  emoji: string;
  labelKey: string;
  duration: MoodDurationPreset;
};

export const MOOD_TEMPLATES: MoodTemplate[] = [
  {
    id: 'sick',
    emoji: '🤒',
    labelKey: 'user_mood:template_sick_label',
    duration: 'today',
  },
  {
    id: 'vacation',
    emoji: '🌴',
    labelKey: 'user_mood:template_vacation_label',
    duration: 'custom',
  },
  {
    id: 'focused',
    emoji: '💡',
    labelKey: 'user_mood:template_focused_label',
    duration: '4h',
  },
  {
    id: 'lunch',
    emoji: '🍕',
    labelKey: 'user_mood:template_lunch_label',
    duration: '1h',
  },
  {
    id: 'meeting',
    emoji: '📅',
    labelKey: 'user_mood:template_meeting_label',
    duration: '1h',
  },
];

// `today` reuses the shared general namespace; the rest live in user_mood.
export const DURATION_PRESETS: {
  value: MoodDurationPreset;
  labelKey: string;
}[] = [
  { value: '30m', labelKey: 'user_mood:duration_30m' },
  { value: '1h', labelKey: 'user_mood:duration_1h' },
  { value: '4h', labelKey: 'user_mood:duration_4h' },
  { value: 'today', labelKey: 'general:today' },
  { value: 'this_week', labelKey: 'user_mood:duration_this_week' },
  { value: 'custom', labelKey: 'user_mood:duration_custom' },
];

export const durationLabelKey = (duration: MoodDurationPreset) =>
  DURATION_PRESETS.find(preset => preset.value === duration)?.labelKey ??
  'user_mood:duration_custom';
