diff --git a/2026-04-20_214654.png b/2026-04-20_214654.png deleted file mode 100644 index 02f69c7..0000000 Binary files a/2026-04-20_214654.png and /dev/null differ diff --git a/2026-04-20_214712.png b/2026-04-20_214712.png deleted file mode 100644 index 016b97c..0000000 Binary files a/2026-04-20_214712.png and /dev/null differ diff --git a/frontend/public/TeeOff.no.png b/frontend/public/TeeOff.no.png new file mode 100644 index 0000000..cf5e182 Binary files /dev/null and b/frontend/public/TeeOff.no.png differ diff --git a/frontend/src/app/admin/rediger/[slug]/EditFacilityClient.tsx b/frontend/src/app/admin/rediger/[slug]/EditFacilityClient.tsx index 268bf08..b6c3ce5 100644 --- a/frontend/src/app/admin/rediger/[slug]/EditFacilityClient.tsx +++ b/frontend/src/app/admin/rediger/[slug]/EditFacilityClient.tsx @@ -1,5 +1,5 @@ "use client"; -import { useRef, useState, type ChangeEvent } from 'react'; +import { useRef, useState, type ChangeEvent, type ReactNode } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { adminFetch } from "@/config/adminFetch"; @@ -133,6 +133,81 @@ const ListObjectEditor = ({ label, value, templateKeys, onChange }: { label: str ); }; +const AccordionSection = ({ + title, + subtitle, + badge, + defaultOpen = false, + tone = 'gray', + children, +}: { + title: string; + subtitle?: string; + badge?: string; + defaultOpen?: boolean; + tone?: 'gray' | 'green'; + children: ReactNode; +}) => { + const tones = { + gray: { + shell: 'border border-gray-200 bg-gray-100', + title: 'text-gray-800', + subtitle: 'text-gray-500', + badge: 'bg-white text-gray-600', + arrow: 'bg-white text-[#11280f]', + content: 'border-t border-gray-200', + }, + green: { + shell: 'border border-[#8bc34a]/30 bg-[#8bc34a]/10', + title: 'text-[#11280f]', + subtitle: 'text-[#435340]', + badge: 'bg-white text-[#536256]', + arrow: 'bg-white text-[#11280f]', + content: 'border-t border-[#8bc34a]/20', + }, + }[tone]; + + return ( +
+ +
+
+

{title}

+ {badge ? ( + + {badge} + + ) : null} +
+ {subtitle ? ( +

{subtitle}

+ ) : null} +
+ + Vis / skjul + +
+
+
+ {children} +
+
+
+ ); +}; + +const ScrollToTopButton = () => { + return ( + + ); +}; + // KOMPONENT 4: DEN NYE SCOREKORT-BYGGEREN const ScorecardBuilder = ({ course, onChange }: { course: any, onChange: (c: any) => void }) => { const ALL_KEYS = ['lengst', 'lang', 'mellomlang', 'mellomkort', 'kort', 'kortest']; @@ -642,6 +717,7 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini return (
+
@@ -821,22 +897,13 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini onChange={handleGalleryUpload} /> -
-
-
-

Anleggsbilder

-

- Last opp AVIF-optimaliserte bilder direkte fra admin. Du kan også fjerne koblingen til et bilde uten å slette selve filen fra serveren. -

-
- {mediaFeedback ? ( -
- {mediaFeedback} -
- ) : null} -
- -
+ +
@@ -1017,7 +1084,7 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini
)}
-
+
handleChange('website_url', e.target.value)} />
handleChange('golfbox_booking_url', e.target.value)} />
@@ -1040,8 +1107,10 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini {activeTab === 'okonomi' && (
{/* MEDLEMSKAP */} -
-

Medlemskap

+
handleChange('membership_updated_at', e.target.value)} /> @@ -1054,11 +1123,13 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini
handleChange('rimeligste_alternativ', Number(e.target.value))} />
handleChange('medlemskap_url', e.target.value)} />
-
+ {/* GREENFEE */} -
-

Greenfee / Gjestespill

+
handleChange('greenfee_url', e.target.value)} />
handleChange('guest_requirements', e.target.value)} />
@@ -1078,11 +1149,14 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini templateKeys={['banenavn', 'priskategori', 'pris_voksne', 'pris_junior']} onChange={(v) => handleChange('greenfee', v)} /> -
+
{/* VEIEN TIL GOLF (VTG) */} -
-

Veien til Golf (VTG)

+
handleChange('vtg_pris', Number(e.target.value))} />
handleChange('vtg_lenke', e.target.value)} />
@@ -1094,7 +1168,7 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini templateKeys={['dato', 'status']} onChange={(v) => handleChange('vtg_datoer', v)} /> -
+
handleChange('amenities', v)} /> @@ -1144,25 +1218,27 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini
{formData.courses?.map((course: any, cIdx: number) => ( -
-
-
-

{course.name}

-
- - - {course.is_main_course ? 'Hovedbane' : 'Sekundærbane'} - -
+ +
+
+ + + {course.is_main_course ? 'Hovedbane' : 'Sekundærbane'} +
@@ -1228,7 +1304,7 @@ export default function EditFacilityClient({ initialData, allFacilities }: { ini }); }} /> -
+ ))}
)}