MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / AddFilterButton

Function AddFilterButton

app/src/components/Filters/AddFilterButton.tsx:7–35  ·  view source on GitHub ↗
({
  filterOptions,
  urlKey,
}: {
  filterOptions: AtLeastOne<FilterOption>;
  urlKey?: string;
})

Source from the content-addressed store, hash-verified

5import { type FilterOption } from "./types";
6
7const AddFilterButton = ({
8 filterOptions,
9 urlKey,
10}: {
11 filterOptions: AtLeastOne<FilterOption>;
12 urlKey?: string;
13}) => {
14 const addFilter = useFilters({ urlKey }).addFilter;
15
16 return (
17 <HStack
18 as={Button}
19 variant="ghost"
20 onClick={() =>
21 addFilter({
22 id: Date.now().toString(),
23 field: filterOptions[0].field,
24 comparator: comparators[0],
25 value: "",
26 })
27 }
28 spacing={0}
29 fontSize="sm"
30 >
31 <Icon as={BsPlus} boxSize={5} />
32 <Text>Add Filter</Text>
33 </HStack>
34 );
35};
36
37export default AddFilterButton;

Callers

nothing calls this directly

Calls 2

useFiltersFunction · 0.90
addFilterFunction · 0.70

Tested by

no test coverage detected