fix: Correct invalid props on StarRating and fallback to 0 on no price in product template.

This commit is contained in:
David Ball 2024-07-11 05:49:40 -04:00
parent 76e6fafc14
commit 7f378d234b
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
interface Props { interface Props {
value: number; value: number;
max: number; max: number;
backgroundColor: string; overlayColor: string;
} }
const { value = 0, max = 5, overlayColor = '#fff' } = Astro.props; const { value = 0, max = 5, overlayColor = '#fff' } = Astro.props;

View File

@ -65,7 +65,7 @@ const category = categories.find(c => c.id == product.categoryId)!;
<p> <p>
{product?.productDetails?.description && product?.productDetails?.description} {product?.productDetails?.description && product?.productDetails?.description}
</p> </p>
<a href={product?.amazonLink} class="btn btn-primary">{formatAsCurrency(product?.productDetails?.price)} On Amazon <span>&rarr;</span></a> <a href={product?.amazonLink} class="btn btn-primary">{formatAsCurrency(product?.productDetails?.price||0)} On Amazon <span>&rarr;</span></a>
</div> </div>
</div> </div>
<br /> <br />