import { ActivityCategory } from "@/app/generated/prisma/enums";

export const ACTIVITY_CATEGORIES: ActivityCategory[] = [
  "HIKING",
  "CAMPING",
  "SNORKELING",
  "DIVING",
  "ISLAND_HOPPING",
  "CITY_TRIP",
  "CULINARY",
  "CONCERT",
  "WORKSHOP",
  "RETREAT",
];

interface CategoryMeta {
  label: string;
  icon: string;
  /// Label untuk field destinasi/subjek aktivitas yang berbeda per kategori.
  destinationLabel: string;
  destinationPlaceholder: string;
}

const META: Record<ActivityCategory, CategoryMeta> = {
  HIKING: {
    label: "Hiking",
    icon: "🏔️",
    destinationLabel: "Nama Gunung",
    destinationPlaceholder: "Gunung Papandayan",
  },
  CAMPING: {
    label: "Camping",
    icon: "🏕️",
    destinationLabel: "Lokasi Camping",
    destinationPlaceholder: "Ranca Upas",
  },
  SNORKELING: {
    label: "Snorkeling",
    icon: "🤿",
    destinationLabel: "Spot Snorkeling",
    destinationPlaceholder: "Pulau Pahawang",
  },
  DIVING: {
    label: "Diving",
    icon: "🐠",
    destinationLabel: "Spot Diving",
    destinationPlaceholder: "Tulamben Bali",
  },
  ISLAND_HOPPING: {
    label: "Island Hopping",
    icon: "🏝️",
    destinationLabel: "Pulau Tujuan",
    destinationPlaceholder: "Kepulauan Seribu",
  },
  CITY_TRIP: {
    label: "City Trip",
    icon: "🏙️",
    destinationLabel: "Kota Tujuan",
    destinationPlaceholder: "Yogyakarta",
  },
  CULINARY: {
    label: "Kulineran",
    icon: "🍜",
    destinationLabel: "Tema Kuliner",
    destinationPlaceholder: "Street Food Bandung",
  },
  CONCERT: {
    label: "Konser",
    icon: "🎤",
    destinationLabel: "Konser / Artis",
    destinationPlaceholder: "Coldplay Jakarta",
  },
  WORKSHOP: {
    label: "Workshop",
    icon: "🛠️",
    destinationLabel: "Topik Workshop",
    destinationPlaceholder: "Fotografi Lanskap",
  },
  RETREAT: {
    label: "Retreat",
    icon: "🧘",
    destinationLabel: "Tema Retreat",
    destinationPlaceholder: "Mindfulness Ubud",
  },
};

export function categoryMeta(category: ActivityCategory): CategoryMeta {
  return META[category];
}

export function categoryLabel(category: ActivityCategory): string {
  return META[category].label;
}

export function categoryIcon(category: ActivityCategory): string {
  return META[category].icon;
}

export function isActivityCategory(value: unknown): value is ActivityCategory {
  return (
    typeof value === "string" &&
    (ACTIVITY_CATEGORIES as string[]).includes(value)
  );
}
