implement exclude bounces feature
This commit is contained in:
1 parent
4a3190b2da
commit
ee698b636a
21 files changed
+189
-69
No files matched your search
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user