mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
This commit is contained in:
parent
4a3190b2da
commit
ee698b636a
21 changed files with 189 additions and 69 deletions
26
src/components/input/BounceFilter.tsx
Normal file
26
src/components/input/BounceFilter.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
'use client';
|
||||
import { Checkbox, Row } from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks/useMessages';
|
||||
import { useNavigation } from '@/components/hooks/useNavigation';
|
||||
|
||||
export function BounceFilter() {
|
||||
const { router, query, updateParams } = useNavigation();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const isSelected = query.excludeBounce === 'true';
|
||||
|
||||
const handleChange = (value: boolean) => {
|
||||
if (value) {
|
||||
router.push(updateParams({ excludeBounce: 'true' }));
|
||||
} else {
|
||||
router.push(updateParams({ excludeBounce: undefined }));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Row alignItems="center" gap>
|
||||
<Checkbox isSelected={isSelected} onChange={handleChange}>
|
||||
{formatMessage(labels.excludeBounce)}
|
||||
</Checkbox>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue