1- import { SimpleGrid , Stack , Text , ThemeIcon , List , Group } from " @mantine/core" ;
2- import { IconCheck } from " @tabler/icons-react" ;
3- import { Layout } from "./Layout .jsx" ;
4- import { MediaBlock } from " ../primitives/MediaBlock.jsx" ;
5- import { CTAButton } from " ../primitives/CTAButton.jsx" ;
1+ import { SimpleGrid , Stack , Text , ThemeIcon , List , Group } from ' @mantine/core'
2+ import { IconCheck } from ' @tabler/icons-react'
3+ import { Section } from './Section .jsx'
4+ import { MediaBlock } from ' ../primitives/MediaBlock.jsx'
5+ import { CTAButton } from ' ../primitives/CTAButton.jsx'
66
77/**
88 * FeatureSplit - Config-driven split content/media feature section.
@@ -11,83 +11,95 @@ import { CTAButton } from "../primitives/CTAButton.jsx";
1111 * @param {object } video - { src, width, filter }
1212 * @param {string } image - image src (alternative to video)
1313 */
14- export function FeatureSplit ( {
15- id,
16- subtitle,
17- title,
18- description,
19- featuresList,
20- cta,
21- video,
22- image,
23- reverse = false ,
24- background = "white" ,
25- } ) {
26- const listComponent = featuresList && featuresList . length > 0 && (
27- < List
28- spacing = "md"
29- size = "md"
30- center
31- icon = {
32- < ThemeIcon color = "gray.2" size = { 24 } radius = "0" >
33- < IconCheck size = { 14 } color = "var(--mantine-color-gray-9)" />
34- </ ThemeIcon >
35- }
36- >
37- { featuresList . map ( ( item , index ) => (
38- < List . Item key = { index } > { item } </ List . Item >
39- ) ) }
40- </ List >
41- ) ;
14+ export function FeatureSplit ( { id, subtitle, title, description, featuresList, cta, video, image, reverse = false , background = 'white' } ) {
15+ const listComponent = featuresList && featuresList . length > 0 && (
16+ < List
17+ spacing = "md"
18+ size = "md"
19+ center
20+ icon = {
21+ < ThemeIcon
22+ color = "gray.2"
23+ size = { 24 }
24+ radius = "0"
25+ >
26+ < IconCheck
27+ size = { 14 }
28+ color = "var(--mantine-color-gray-9)"
29+ />
30+ </ ThemeIcon >
31+ }
32+ >
33+ { featuresList . map ( ( item , index ) => (
34+ < List . Item key = { index } > { item } </ List . Item >
35+ ) ) }
36+ </ List >
37+ )
4238
43- const contentCol = (
44- < Stack justify = "center" gap = "lg" >
45- { description && (
46- < Text c = "gray.6" size = "xl" lh = { 1.6 } >
47- { description }
48- </ Text >
49- ) }
39+ const contentCol = (
40+ < Stack
41+ justify = "center"
42+ gap = "lg"
43+ >
44+ { description && (
45+ < Text
46+ c = "gray.6"
47+ size = "xl"
48+ lh = { 1.6 }
49+ >
50+ { description }
51+ </ Text >
52+ ) }
5053
51- { listComponent }
54+ { listComponent }
5255
53- { cta && (
54- < Group mt = "md" >
55- < CTAButton
56- label = { cta . label }
57- href = { cta . href }
58- icon = { cta . icon }
59- size = { cta . size || "lg" }
60- variant = { cta . variant }
61- color = { cta . color }
62- />
63- </ Group >
64- ) }
65- </ Stack >
66- ) ;
56+ { cta && (
57+ < Group mt = "md" >
58+ < CTAButton
59+ label = { cta . label }
60+ href = { cta . href }
61+ icon = { cta . icon }
62+ size = { cta . size || 'lg' }
63+ variant = { cta . variant }
64+ color = { cta . color }
65+ />
66+ </ Group >
67+ ) }
68+ </ Stack >
69+ )
6770
68- const mediaCol = ( video || image ) && (
69- < MediaBlock video = { video } image = { image } width = "80%" />
70- ) ;
71+ const mediaCol = ( video || image ) && (
72+ < MediaBlock
73+ video = { video }
74+ image = { image }
75+ width = "80%"
76+ />
77+ )
7178
72- return (
73- < Layout id = { id } subtitle = { subtitle } title = { title } background = { background } >
74- < SimpleGrid
75- cols = { { base : 1 , md : 2 } }
76- spacing = { { base : 40 , md : 80 } }
77- verticalSpacing = { { base : 40 , md : 50 } }
78- >
79- { reverse ? (
80- < >
81- { mediaCol }
82- { contentCol }
83- </ >
84- ) : (
85- < >
86- { contentCol }
87- { mediaCol }
88- </ >
89- ) }
90- </ SimpleGrid >
91- </ Layout >
92- ) ;
79+ return (
80+ < Section
81+ id = { id }
82+ subtitle = { subtitle }
83+ title = { title }
84+ background = { background }
85+ >
86+ < SimpleGrid
87+ cols = { { base : 1 , md : 2 } }
88+ spacing = { { base : 40 , md : 80 } }
89+ verticalSpacing = { { base : 40 , md : 50 } }
90+ >
91+ { reverse ? (
92+ < >
93+ { mediaCol }
94+ { contentCol }
95+ </ >
96+ ) : (
97+ < >
98+ { contentCol }
99+ { mediaCol }
100+ </ >
101+ ) }
102+ </ SimpleGrid >
103+ </ Section >
104+ )
93105}
0 commit comments