Sha256: b80a57c8542f3deca987314199bb9a80841e316cea7b61df361170c15184f532

Contents?: true

Size: 760 Bytes

Versions: 142

Compression:

Stored size: 760 Bytes

Contents

/* @flow */

import React from 'react'
import { Caption, TitleCount } from '../../'

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

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

export default ResultsCount

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-6.5.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-6.5.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-6.4.2 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.1.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-6.4.1 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx
playbook_ui-6.4.0 app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx