22import { Picture } from " astro:assets" ;
33interface Props {
44 title: string ;
5- edge : " left" | " right" ;
5+ " align-image " : " left" | " right" ;
66 image: ImageMetadata ;
77 imageAlt: string ;
88}
99
10- const { title, edge , image, imageAlt } = Astro .props ;
10+ const { title, " align-image " : align , image, imageAlt } = Astro .props ;
1111---
1212
1313<section class =" mt-16 lg:grid lg:items-center" >
@@ -16,9 +16,9 @@ const { title, edge, image, imageAlt } = Astro.props;
1616 class:list ={ [
1717 " isolate h-[300px] overflow-clip md:h-[400px] lg:h-[500px] lg:w-1/2 xl:h-[600px]" ,
1818 {
19- left: " lg:ml-auto lg: rounded-l -2xl" ,
20- right: " lg:rounded-r -2xl" ,
21- }[edge ],
19+ left: " lg:rounded-r -2xl" ,
20+ right: " lg:ml-auto lg: rounded-l -2xl" ,
21+ }[align ],
2222 ]}
2323 >
2424 <Picture
@@ -35,7 +35,7 @@ const { title, edge, image, imageAlt } = Astro.props;
3535 style ={ { gridArea: " 1 / 1" }}
3636 class =" container mx-auto lg:max-w-screen-lg"
3737 >
38- <div class:list ={ [" p-8 lg:w-1/2" , edge === " right " && " lg:ml-auto" ]} >
38+ <div class:list ={ [" p-8 lg:w-1/2" , align === " left " && " lg:ml-auto" ]} >
3939 <h2 class =" text-4xl" >{ title } </h2 >
4040 <div class =" prose mt-4 max-w-none" >
4141 <slot />
0 commit comments