@@ -33,6 +33,8 @@ export interface CompareCardProps {
3333 noOtherDetailsLabel ?: string ;
3434 viewOptionsLabel ?: string ;
3535 preorderLabel ?: string ;
36+ showMoreLabel ?: string ;
37+ showLessLabel ?: string ;
3638 addToCartAction ?: CompareAddToCartAction ;
3739 imageSizes ?: string ;
3840}
@@ -66,6 +68,8 @@ export function CompareCard({
6668 noOtherDetailsLabel = 'There are no other details.' ,
6769 viewOptionsLabel = 'View options' ,
6870 preorderLabel = 'Preorder' ,
71+ showMoreLabel = 'Show more' ,
72+ showLessLabel = 'Show less' ,
6973 imageSizes,
7074} : CompareCardProps ) {
7175 return (
@@ -110,7 +114,7 @@ export function CompareCard({
110114 { descriptionLabel }
111115 </ div >
112116 { product . description != null && product . description !== '' ? (
113- < Reveal >
117+ < Reveal hideLabel = { showLessLabel } showLabel = { showMoreLabel } >
114118 < div className = "prose prose-sm [&>div>*:first-child]:mt-0" > { product . description } </ div >
115119 </ Reveal >
116120 ) : (
@@ -124,7 +128,7 @@ export function CompareCard({
124128 < div className = "font-[family-name:var(--compare-card-font-family-secondary,var(--font-family-mono))] text-xs font-normal uppercase text-[var(--compare-card-label,hsl(var(--foreground)))]" >
125129 { otherDetailsLabel }
126130 </ div >
127- < Reveal >
131+ < Reveal hideLabel = { showLessLabel } showLabel = { showMoreLabel } >
128132 < dl className = "grid grid-cols-2 gap-1 text-xs font-normal text-[var(--compare-card-field,hsl(var(--foreground)))]" >
129133 { product . customFields . map ( ( field , index ) => (
130134 < Fragment key = { index } >
0 commit comments