general category trip
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
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)
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ export const LIMITS = {
|
||||
MAX_PARTICIPANTS: 15,
|
||||
MAX_PRICE_IDR: 100_000_000,
|
||||
MAX_TITLE_LENGTH: 120,
|
||||
MAX_MOUNTAIN_LENGTH: 100,
|
||||
MAX_DESTINATION_LENGTH: 100,
|
||||
MAX_LOCATION_LENGTH: 120,
|
||||
MAX_DESCRIPTION_LENGTH: 5000,
|
||||
/** Meeting point & tiap blok include/exclude */
|
||||
|
||||
Reference in New Issue
Block a user