33import { Swiper , SwiperSlide } from 'swiper/react' ;
44import { Pagination , Navigation , Mousewheel , EffectFade } from 'swiper/modules' ;
55import BackgroundImage from '../BackgroundImage' ;
6- import ProjectStatus from '../ProjectGrid/ProjectStatus ' ;
6+ import { formatDates } from '@/utilities/formatDates ' ;
77
88import 'swiper/css' ;
99import 'swiper/css/pagination' ;
1010import 'swiper/css/navigation' ;
1111import 'swiper/css/effect-fade' ;
1212
13- // ─── Helper ───────────────────────────────────────────────────────────────────
14- function formatDateRange ( start , end ) {
15- const opts = { day : 'numeric' , month : 'short' , year : 'numeric' } ;
16- const s = new Date ( start ) . toLocaleDateString ( 'da-DK' , opts ) ;
17- const e = new Date ( end ) . toLocaleDateString ( 'da-DK' , opts ) ;
18- return `${ s } – ${ e } ` ;
19- }
20-
21- // ─── Component ────────────────────────────────────────────────────────────────
2213export default function ProjectCarousel ( { projects } ) {
2314 const total = projects . length ;
2415
@@ -64,6 +55,11 @@ export default function ProjectCarousel({ projects }) {
6455 </ span >
6556 </ div >
6657
58+ { /* Section label */ }
59+ < p className = "text-paper/50 text-[10px] uppercase tracking-[0.25em] mb-2" >
60+ Kommende projekter
61+ </ p >
62+
6763 { /* Big title */ }
6864 < h2
6965 className = "text-paper font-black uppercase leading-none"
@@ -72,17 +68,10 @@ export default function ProjectCarousel({ projects }) {
7268 { project . title }
7369 </ h2 >
7470
75- { /* Status badge */ }
76- { project . startDate && (
77- < div className = "mt-3" >
78- < ProjectStatus startDate = { project . startDate } endDate = { project . endDate } />
79- </ div >
80- ) }
81-
8271 { /* Date & location */ }
8372 < div className = "mt-2" >
8473 < p className = "text-paper text-xs tracking-widest" >
85- { formatDateRange ( project . startDate , project . endDate ) }
74+ { formatDates ( project . startDate , project . endDate ) }
8675 </ p >
8776 { project . location && (
8877 < p className = "text-paper/50 text-[11px] mt-1 tracking-wider" >
@@ -121,35 +110,6 @@ export default function ProjectCarousel({ projects }) {
121110 Næste
122111 </ span >
123112 </ button >
124-
125- { /* ── Styles ── */ }
126- < style > { `
127- .swiper-pagination-progressbar {
128- display: none;
129- }
130- .swiper-pagination-custom .swiper-pagination-bullet {
131- width: 6px;
132- height: 6px;
133- border-radius: 9999px;
134- background: rgba(var(--color-paper-rgb, 255 255 255) / 0.5);
135- transition: all 0.3s ease;
136- display: inline-block;
137- cursor: pointer;
138- }
139- .swiper-pagination-custom .swiper-pagination-bullet-active {
140- width: 24px;
141- height: 2px;
142- border-radius: 2px;
143- background: var(--color-paper, #fff);
144- }
145- .swiper-button-next,
146- .swiper-button-prev {
147- display: none !important;
148- }
149- .swiper-button-disabled {
150- opacity: 1 !important;
151- }
152- ` } </ style >
153113 </ section >
154114 ) ;
155115}
0 commit comments