import { createElement } from '@wordpress/element' import { useSelect } from '@wordpress/data' import { __ } from 'ct-i18n' const BrandsPreview = ({ product, attributes }) => { const { product_brands } = useSelect((select) => { return { product_brands: select('core').getEntityRecords('taxonomy', 'product_brands', { per_page: -1, post: product.id, }) || [], } }) if (product_brands.length === 0) { return '' } return (