Sha256: b4284fe22a767b8f541fe71348ef8dba2f199eebdda16bf009c02f5827381424
Contents?: true
Size: 1.88 KB
Versions: 92
Compression:
Stored size: 1.88 KB
Contents
import React from 'react' import { isEmpty } from 'lodash' import Flex from '../../pb_flex/_flex' import CurrentFilters, { FilterDescription } from './CurrentFilters' import FilterBackground, { FilterBackgroundProps } from './FilterBackground' import FiltersPopover from './FiltersPopover' import ResultsCount from './ResultsCount' import SortMenu, { SortingChangeCallback, SortOptions, SortValue, } from './SortMenu' export type FilterSingleProps = { children?: React.ReactChild[] | React.ReactChild, filters?: FilterDescription, onSortChange?: SortingChangeCallback, results?: number, sortOptions?: SortOptions, sortValue?: SortValue[], } & FilterBackgroundProps const FilterSingle = ({ onSortChange, sortOptions, sortValue, filters, results, children, dark, maxHeight, minWidth, placement, popoverProps, ...bgProps }: FilterSingleProps): React.ReactElement => { return ( <FilterBackground dark={dark} {...bgProps} > <Flex orientation="row" paddingRight="lg" vertical="center" > { children && <> <FiltersPopover dark={dark} maxHeight={maxHeight} minWidth={minWidth} placement={placement} popoverProps={popoverProps} > {children} </FiltersPopover> <CurrentFilters dark={dark} filters={filters} /> </> } <ResultsCount dark={dark} results={results} /> { !isEmpty(sortOptions) && <SortMenu dark={dark} onChange={onSortChange} options={sortOptions} value={sortValue} /> } </Flex> </FilterBackground> ) } export default FilterSingle
Version data entries
92 entries across 92 versions & 1 rubygems