Sha256: 75e186ae6d51f32deca66f6fee36c2801f07dec3bbfc81682c1afe164b2c4512

Contents?: true

Size: 891 Bytes

Versions: 165

Compression:

Stored size: 891 Bytes

Contents

/* @flow */

import React from 'react'

import Caption from '../../pb_caption/_caption'
import TitleCount from '../../pb_title_count/_title_count'

const resultsText = (results: number): string => results == 1 ? 'Result' : 'Results'

type ResultsCountProps = {
  dark?: boolean,
  results?: ?number,
  title?: boolean,
}
const ResultsCount = ({ dark, results, title }: ResultsCountProps) => (
  <Choose>
    <When condition={results && title}>
      <TitleCount
          align="center"
          count={results}
          dark={dark}
          title={`${resultsText(results)}:`}
      />
    </When>
    <When condition={results}>
      <Caption
          className="filter-results"
          dark={dark}
          size="xs"
          text={`${results} ${resultsText(results)}`}
      />
    </When>
    <Otherwise>
      <div />
    </Otherwise>
  </Choose>
)

export default ResultsCount

Version data entries

165 entries across 165 versions & 1 rubygems

Version Path
playbook_ui-10.19.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.17.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.16.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.15.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.15.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.14.1.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.14.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.13.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.13.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.12.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.11.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-10.10.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx