/**
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import classNames from 'classnames';
import ReadMore from '@woocommerce/base-components/read-more';
import type { BlockAttributes } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import './style.scss';
import type { Review } from '../types';
function getReviewImage(
review: Review,
imageType: string,
isLoading: boolean
): JSX.Element {
if ( isLoading || ! review ) {
return (
);
}
return (
{ imageType === 'product' ? (
) : (
// The alt text is left empty on purpose, as it's considered a decorative image.
// More can be found here: https://www.w3.org/WAI/tutorials/images/decorative/.
// Github discussion for a context: https://github.com/woocommerce/woocommerce-blocks/pull/7651#discussion_r1019560494.
) }
{ review.verified && (
);
};
/**
* BE AWARE. ReviewListItem expects product data that is equivalent to what is
* made available for output in a public view. Thus content that may contain
* html data is not sanitized further.
*
* Currently the following data is trusted (assumed to already be sanitized):
* - `review.review` (review content)
* - `review.product_name` (the product title)
*/
export default ReviewListItem;