fix: Correct invalid props on StarRating and fallback to 0 on no price in product template.
This commit is contained in:
parent
76e6fafc14
commit
7f378d234b
|
@ -2,7 +2,7 @@
|
|||
interface Props {
|
||||
value: number;
|
||||
max: number;
|
||||
backgroundColor: string;
|
||||
overlayColor: string;
|
||||
}
|
||||
|
||||
const { value = 0, max = 5, overlayColor = '#fff' } = Astro.props;
|
||||
|
|
|
@ -65,7 +65,7 @@ const category = categories.find(c => c.id == product.categoryId)!;
|
|||
<p>
|
||||
{product?.productDetails?.description && product?.productDetails?.description}
|
||||
</p>
|
||||
<a href={product?.amazonLink} class="btn btn-primary">{formatAsCurrency(product?.productDetails?.price)} On Amazon <span>→</span></a>
|
||||
<a href={product?.amazonLink} class="btn btn-primary">{formatAsCurrency(product?.productDetails?.price||0)} On Amazon <span>→</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
|
Loading…
Reference in New Issue
Block a user