-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPriceFilter.tsx
More file actions
33 lines (29 loc) · 877 Bytes
/
PriceFilter.tsx
File metadata and controls
33 lines (29 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { CheckboxField, Stack, Title } from "@buildo/bento-design-system";
import { useTranslation } from "react-i18next";
type PriceFilterProps = {
price: boolean[];
setPrice: (arg: boolean[]) => void;
};
function PriceFilter({ price, setPrice }: PriceFilterProps) {
const { t } = useTranslation();
return (
<Stack space={8} align="left">
<Title size="small">{t("priceRangefilter")}</Title>
{[...Array(4).keys()].map((_, position) => {
return (
<CheckboxField
key={"checkbox-" + position}
label={"$".repeat(position + 1)}
value={price[position]}
onChange={() => {
setPrice(
price.map((item, index) => (index === position ? !item : item))
);
}}
/>
);
})}
</Stack>
);
}
export default PriceFilter;