implement exclude bounces feature
Some checks failed
Node.js CI / build (push) Has been cancelled

This commit is contained in:
Francis Cao 2026-01-30 00:12:13 -08:00
parent 4a3190b2da
commit ee698b636a
21 changed files with 189 additions and 69 deletions

View 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>
);
}