diff --git a/frontend/src/app/FacilitySearch.tsx b/frontend/src/app/FacilitySearch.tsx
index eff79cc..26e4401 100755
--- a/frontend/src/app/FacilitySearch.tsx
+++ b/frontend/src/app/FacilitySearch.tsx
@@ -17,6 +17,7 @@ type Facility = {
id: number;
slug: string;
name: string;
+ description?: string | null;
city?: string | null;
county?: string | null;
banetype?: string | null;
@@ -212,6 +213,13 @@ const buildMapUrl = (lat?: number | null, lng?: number | null) => {
return `https://www.google.com/maps/search/?api=1&query=${lat},${lng}`;
};
+const toPlainText = (value: string | null | undefined) =>
+ String(value || "")
+ .replace(/<[^>]+>/g, " ")
+ .replace(/ /gi, " ")
+ .replace(/\s+/g, " ")
+ .trim();
+
const getAreaLabel = (value: string, countyOptions: Array<{ slug: string; label: string }>) => {
if (!value) return "Hele Norge";
const builtIn = HIERARCHICAL_AREA_OPTIONS.find((option) => option.value === value);
@@ -256,7 +264,7 @@ const noteClampStyle: CSSProperties = {
};
const actionIconClassName =
- "flex h-10 w-10 items-center justify-center rounded-[0.95rem] border border-[#D5DDD1] bg-white text-[#112015] transition hover:border-[#FF5722] hover:text-[#FF5722]";
+ "flex h-7 w-7 items-center justify-center rounded-[0.8rem] border border-[#D5DDD1] bg-white text-[#112015] transition hover:border-[#FF5722] hover:text-[#FF5722]";
export default function FacilitySearch({
initialFacilities,
@@ -580,26 +588,36 @@ export default function FacilitySearch({
/>
-
-
- {getStatusLabel(facility.primaryStatus)}
-
- {facility.hasGolfamore && (
-
- Golfamore
+
+
+
+ {getStatusLabel(facility.primaryStatus)}
- )}
- {facility.hasNSG && (
-
- NSG
-
- )}
+ {facility.hasGolfamore && (
+
+ Golfamore
+
+ )}
+ {facility.hasNSG && (
+
+ NSG
+
+ )}
+
+ {facility.status_updated_at && (
+
+
+ {formatUpdatedDate(facility.status_updated_at)}
+
+
+ )}
+
{facility.city} • {facility.county}
@@ -611,26 +629,20 @@ export default function FacilitySearch({
-
-
- {facility.holeValue || "--"} hull
-
-
- {facility.banetype || "Banetype ukjent"}
-
-
-
-
-
- Oppdatert {formatUpdatedDate(facility.status_updated_at)}
-
-
- {sortMethod === "dist" && Number.isFinite(facility.distance)
- ? `${Math.round(facility.distance)} km unna`
- : sortMethod === "updated"
- ? "Nyeste status"
- : "Alfabetisk"}
-
+
+
+
+ {facility.holeValue || "--"} hull
+
+
+ {facility.banetype || "Banetype ukjent"}
+
+
+ {Number.isFinite(facility.distance) && (
+
+ {Math.round(facility.distance)} km unna
+
+ )}
{facility.footnote && (
@@ -644,7 +656,15 @@ export default function FacilitySearch({
)}
-
+ {toPlainText(facility.description) && (
+
+ {toPlainText(facility.description)}
+
+ )}
+
+
+
{facility.phone ? facility.phone : facility.city || "Se detaljer"}
+
-
-
- {facility.phone ? facility.phone : facility.city || "Se detaljer"}
-
- Se anlegg →
+
+
+ Se anlegg
@@ -690,7 +707,7 @@ export default function FacilitySearch({
function ActionIcon({ type }: { type: "web" | "booking" | "trophy" | "pin" | "weather" }) {
return (