@@ -3,6 +3,7 @@ import { useRef } from "react";
33import { cn } from "@/app/components/utils" ;
44import { Container } from "./container" ;
55import { useMediaQuery } from "@/hooks/useMediaQuery" ;
6+ import { Button } from "@/app/components/ui/button" ;
67
78export type CardCariuselSectionProps = {
89 className ?: string ;
@@ -17,6 +18,8 @@ export type CardCariuselSectionProps = {
1718 tabletLastPageOffset ?: number ;
1819 mobileLastPageOffset ?: number ;
1920 startIndex ?: number ;
21+ cta ?: React . ReactNode ;
22+ ctaHref ?: string ;
2023} ;
2124
2225export const CardCariuselSection : React . FC < CardCariuselSectionProps > = ( {
@@ -32,6 +35,8 @@ export const CardCariuselSection: React.FC<CardCariuselSectionProps> = ({
3235 tabletLastPageOffset = 1 ,
3336 mobileLastPageOffset = 1 ,
3437 startIndex,
38+ cta,
39+ ctaHref,
3540} ) => {
3641 const carouselRef = useRef ( null ) ;
3742 const isTablet = useMediaQuery ( "(min-width: 768px)" ) ;
@@ -52,7 +57,7 @@ export const CardCariuselSection: React.FC<CardCariuselSectionProps> = ({
5257 wrapperClassName ,
5358 ) }
5459 >
55- < Container className = "mb-twd-8 xl:mb-twd-12 flex flex-col xl :flex-row xl :items-end xl :justify-between gap-twd-4" >
60+ < Container className = "mb-twd-8 xl:mb-twd-12 flex flex-col md :flex-row md :items-end md :justify-between gap-twd-4" >
5661 { ( title || subtitle ) && (
5762 // Title and subtitle
5863 < div className = "max-w-xl" >
@@ -64,10 +69,34 @@ export const CardCariuselSection: React.FC<CardCariuselSectionProps> = ({
6469 ) }
6570 </ div >
6671 ) }
67- { totalItems > 1 ? (
68- // Carousel controls
69- < div className = "hidden xl:inline-flex" >
70- < CarouselControls carouselRef = { carouselRef } />
72+ { totalItems > 1 || cta ? (
73+ < div className = "flex gap-twd-3 items-center" >
74+ { /** CTA */ }
75+ { cta && (
76+ < Button
77+ className = "h-12 w-auto nd-body-m"
78+ asChild
79+ variant = "secondary-outline"
80+ size = "lg"
81+ rounded
82+ >
83+ < a
84+ className = "text-inherit"
85+ href = { ctaHref }
86+ target = "_blank"
87+ rel = "noopener noreferrer"
88+ >
89+ { cta }
90+ </ a >
91+ </ Button >
92+ ) }
93+
94+ { /* Carousel controls */ }
95+ { totalItems > 1 ? (
96+ < div className = "hidden xl:inline-flex" >
97+ < CarouselControls carouselRef = { carouselRef } />
98+ </ div >
99+ ) : null }
71100 </ div >
72101 ) : null }
73102 </ Container >
0 commit comments