{
+ this.handleTabClick(bucket, facet.label);
+ }}
+ className="facet-tab"
+ >
+
+ {value} ({count})
+
+
,
+ );
+ }
+ });
+ this.setState({ tabsList: tabs });
+ }
+
+ populateTabs(props: FacetTabsProps) {
+ const { facetName, facet } = props;
+
+ if (facet && facet.buckets) {
+ this.getTabsFromFacet(facet);
+ } else if (facetName) {
+ const searcher = this.context.searcher;
+ if (searcher && searcher.state.response) {
+ if (searcher.state.response.facets) {
+ searcher.state.response.facets.forEach((currentFacet: SearchFacet) => {
+ if (currentFacet.field === facetName && currentFacet.buckets) {
+ this.getTabsFromFacet(currentFacet);
+ }
+ });
+ }
+ }
+ }
+ }
+
+ render() {
+ const tabData = this.state.tabsList;
+ const tabs =
+ tabData.length > 0 ? (
+