-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathbonus-product-quantity.jsx
More file actions
45 lines (42 loc) · 1.45 KB
/
bonus-product-quantity.jsx
File metadata and controls
45 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import React from 'react'
import PropTypes from 'prop-types'
import {FormattedMessage, useIntl} from 'react-intl'
import {Text, Skeleton} from '@salesforce/retail-react-app/app/components/shared/ui'
const BonusProductQuantity = ({product}) => {
const intl = useIntl()
return (
<Skeleton isLoaded={product}>
<Text
fontSize="sm"
color="gray.700"
aria-label={intl.formatMessage(
{
id: 'item_variant.quantity.label',
defaultMessage:
'Quantity selector for {productName}. Selected quantity is {quantity}'
},
{
quantity: product?.quantity,
productName: product?.name
}
)}
>
<FormattedMessage
defaultMessage="Quantity: {quantity}"
id="bonus_product_item.label.quantity"
values={{quantity: product?.quantity}}
/>
</Text>
</Skeleton>
)
}
BonusProductQuantity.propTypes = {
product: PropTypes.object
}
export default BonusProductQuantity