Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions components/press-kit/PerformanceList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Badge } from "@/components/ui/badge";
import { getDisplayLocation } from "@/lib/performance-location";
import { Performance, VenuesByCity } from "@/types/press-kit";

type PerformanceListProps = {
Expand Down Expand Up @@ -42,7 +43,12 @@ export function PerformanceList({
<h4 className="font-medium text-white group-hover:text-[#ff5500] transition-colors">
{gig.venue}
</h4>
<p className="text-sm text-gray-400">{gig.location}</p>
{(() => {
const location = getDisplayLocation(gig);
return location ? (
<p className="text-sm text-gray-400">{location}</p>
) : null;
})()}
</div>
</div>
))}
Expand Down Expand Up @@ -73,7 +79,11 @@ export function PerformanceList({
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{Object.entries(
pastGigs.reduce((acc: VenuesByCity, gig: Performance) => {
const city = gig.location || "Other";
const city = getDisplayLocation(gig);

// If we don't have a credible location, we don't group it under a fake bucket.
if (!city) return acc;

if (!acc[city]) {
acc[city] = [];
}
Expand Down
45 changes: 45 additions & 0 deletions lib/performance-location.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Performance } from "@/types/press-kit";

// Locations we consider "unknown" / not worth displaying.
const HIDDEN_LOCATION_VALUES = new Set([
"",
"unknown",
"n/a",
"na",
"tbd",
"other",
]);

// Known venue -> canonical location overrides (researched / standardized).
// If a venue is in here, we prefer this value over whatever is stored in Sanity.
const VENUE_LOCATION_OVERRIDES: Record<string, string> = {
// Nature One takes place at Raketenbasis Pydna near Kastellaun.
"NatureOne Camp": "Kastellaun (Pydna), Germany",

// Halle venues: ensure we show Halle (Saale) consistently.
"Station Endlos": "Halle (Saale), Germany",
"Charles Bronson": "Halle (Saale), Germany",

// Magdeburg venue naming.
"Gewächshäuser": "Magdeburg, Germany",

// If we only have the region, make it explicit.
"Rooftop Party@ Villa Palma": "Sardinia, Italy",
};

function normalizeKey(s: string) {
return s.trim();
}

export function getDisplayLocation(gig: Pick<Performance, "venue" | "location">) {
const venue = normalizeKey(gig.venue ?? "");
const rawLocation = normalizeKey(gig.location ?? "");

const override = VENUE_LOCATION_OVERRIDES[venue];
const location = (override ?? rawLocation).trim();

if (!location) return null;
if (HIDDEN_LOCATION_VALUES.has(location.toLowerCase())) return null;

return location;
}
Loading