-
-
Notifications
You must be signed in to change notification settings - Fork 12
Root: ui|v2.5|src|components|List|Filters: FilterButton.tsx
Serechops edited this page Apr 10, 2024
·
1 revision
The FilterButton
component is a React functional component responsible for rendering a button that allows users to access filters and displays a badge indicating the number of active filters applied.
The purpose of the FilterButton
component is to provide users with a visual indicator of the presence of active filters and allow them to access the filter interface when clicked.
-
filter
: An instance ofListFilterModel
representing the filter model containing information about the applied filters. -
onClick
: A callback function invoked when the filter button is clicked.
- Renders a button with an icon (filter icon) and a badge indicating the number of active filters applied.
- Utilizes the
Icon
component fromsrc/components/Shared/Icon
to render the filter icon. - The badge displays the count of active filters based on the
count()
method of thefilter
object. - Invokes the
onClick
callback function when the button is clicked to trigger the display of the filter interface.
import { FilterButton } from "./FilterButton";
// Inside a React component
<FilterButton filter={listFilterModel} onClick={handleFilterButtonClick} />
The FilterButton component enhances user experience by providing a visual cue for the presence of active filters and enabling easy access to the filter interface.