'use client'; import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import React from 'react'; import { DatePicker } from '../DatePicker'; import { MessageFilterParams } from '@/lib/types'; import { Checkbox } from '../ui/checkbox'; export interface MessageFilterProps { messageFilter: MessageFilterParams; } const MessageFilter: React.FC = ({ messageFilter }) => { const searchParams = useSearchParams(); const pathname = usePathname(); const { push, refresh } = useRouter(); return (
{ const params = new URLSearchParams(searchParams); params.set('date', newDate); push(`${pathname}?${params.toString()}`); }} />
{ const params = new URLSearchParams(searchParams); params.set('includeExamples', String(checked)); push(`${pathname}?${params.toString()}`); }} />
); }; export default MessageFilter;