forked from vtex-apps/search-result
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectedFilters.js
More file actions
33 lines (29 loc) · 862 Bytes
/
Copy pathSelectedFilters.js
File metadata and controls
33 lines (29 loc) · 862 Bytes
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
import PropTypes from 'prop-types'
import React from 'react'
import { intlShape, injectIntl } from 'react-intl'
import FacetItem from './FacetItem'
import FilterOptionTemplate from './FilterOptionTemplate'
import { facetOptionShape } from '../constants/propTypes'
/**
* Search Filter Component.
*/
const SelectedFilters = ({ filters = [], intl }) => {
const title = intl.formatMessage({ id: 'store/search.selected-filters' })
return (
<FilterOptionTemplate
title={title}
filters={filters}
collapsable={false}
selected
>
{facet => <FacetItem key={facet.name} facet={facet} />}
</FilterOptionTemplate>
)
}
SelectedFilters.propTypes = {
/** Selected filters. */
filters: PropTypes.arrayOf(facetOptionShape).isRequired,
/** Intl instance. */
intl: intlShape,
}
export default injectIntl(SelectedFilters)