Så alt er med
This commit is contained in:
parent
4713eced56
commit
137328d795
1 changed files with 17 additions and 7 deletions
|
|
@ -5,7 +5,6 @@ import { STATUS_MAP } from "@/config/constants";
|
||||||
// Designerens definisjon av fargetemaer - Nå med kraftigere tints for kolonnene
|
// Designerens definisjon av fargetemaer - Nå med kraftigere tints for kolonnene
|
||||||
const getTeeTheme = (label: string) => {
|
const getTeeTheme = (label: string) => {
|
||||||
const name = label.toLowerCase();
|
const name = label.toLowerCase();
|
||||||
|
|
||||||
if (name.includes("svart") || name.includes("black")) {
|
if (name.includes("svart") || name.includes("black")) {
|
||||||
return { header: "bg-gray-900 text-white", col: "bg-gray-100", text: "text-gray-900" };
|
return { header: "bg-gray-900 text-white", col: "bg-gray-100", text: "text-gray-900" };
|
||||||
}
|
}
|
||||||
|
|
@ -53,6 +52,7 @@ export default function CourseDisplay({ course }: { course: any }) {
|
||||||
// Kalkulering av SpH
|
// Kalkulering av SpH
|
||||||
const activeTee = availableTees[selectedTeeIndex];
|
const activeTee = availableTees[selectedTeeIndex];
|
||||||
let playingHandicap = 0;
|
let playingHandicap = 0;
|
||||||
|
|
||||||
if (activeTee && hcp) {
|
if (activeTee && hcp) {
|
||||||
const exactHcp = Number(hcp.replace(',', '.'));
|
const exactHcp = Number(hcp.replace(',', '.'));
|
||||||
const slope = Number(activeTee.slopeverdi || activeTee.slopeverdi_damer || 113);
|
const slope = Number(activeTee.slopeverdi || activeTee.slopeverdi_damer || 113);
|
||||||
|
|
@ -70,6 +70,11 @@ export default function CourseDisplay({ course }: { course: any }) {
|
||||||
const sumPar = (holes: any[]) => holes.reduce((acc, h) => acc + (h.par || 0), 0);
|
const sumPar = (holes: any[]) => holes.reduce((acc, h) => acc + (h.par || 0), 0);
|
||||||
const sumLen = (holes: any[], key: string) => holes.reduce((acc, h) => acc + (h.lengths?.[key] || 0), 0);
|
const sumLen = (holes: any[], key: string) => holes.reduce((acc, h) => acc + (h.lengths?.[key] || 0), 0);
|
||||||
|
|
||||||
|
// Formater utløpsdato
|
||||||
|
const slopeExpiry = course.slope_valid_until
|
||||||
|
? new Date(course.slope_valid_until).toLocaleDateString('nb-NO', { year: 'numeric', month: 'short', day: 'numeric' })
|
||||||
|
: 'Ukjent';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white rounded-[3rem] shadow-sm border border-gray-200 overflow-hidden mb-12">
|
<div className="bg-white rounded-[3rem] shadow-sm border border-gray-200 overflow-hidden mb-12">
|
||||||
|
|
||||||
|
|
@ -77,7 +82,12 @@ export default function CourseDisplay({ course }: { course: any }) {
|
||||||
<div className="p-8 md:p-12 flex flex-col md:flex-row justify-between items-center gap-8 border-b border-gray-100 bg-white">
|
<div className="p-8 md:p-12 flex flex-col md:flex-row justify-between items-center gap-8 border-b border-gray-100 bg-white">
|
||||||
<div className="text-center md:text-left">
|
<div className="text-center md:text-left">
|
||||||
<h2 className="text-5xl font-black text-[#11280f] tracking-tighter">{course.name}</h2>
|
<h2 className="text-5xl font-black text-[#11280f] tracking-tighter">{course.name}</h2>
|
||||||
<p className="text-[#7ca982] font-black uppercase text-xs tracking-[0.2em] mt-2">Par {course.par} • {course.length_meters || '--'} meter</p>
|
<p className="text-[#7ca982] font-black uppercase text-xs tracking-[0.2em] mt-2 mb-1">
|
||||||
|
Par {course.par} • {course.length_meters || '--'} meter
|
||||||
|
</p>
|
||||||
|
<p className="text-gray-400 text-[10px] font-bold uppercase tracking-widest">
|
||||||
|
Rating utløper: {slopeExpiry}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-6 bg-gray-50 p-6 rounded-[2.5rem] border border-gray-100">
|
<div className="flex items-center gap-6 bg-gray-50 p-6 rounded-[2.5rem] border border-gray-100">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue