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-12.5.0.pre.alpha.datepickerinput1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.5.0.pre.alpha.phonerails1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.5.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.4.0.pre.alpha.map1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.4.0.pre.alpha.devdocstest1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.4.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.3.1.pre.alpha.phone1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.3.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.3.0.pre.alpha.patchtest1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.3.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.2.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.1.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-12.0.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.20.0.pre.alpha.passthrough1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.20.0.pre.alpha.railsdialog1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.20.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx