import { useRouter } from 'next/router' import { Select, DatePicker } from './form' import { WHENS } from '../lib/constants' import { whenToFrom } from '../lib/time' export function UsageHeader () { const router = useRouter() const select = async values => { const { when, ...query } = values if (when !== 'custom') { delete query.from; delete query.to } if (query.from && !query.to) return await router.push({ pathname: `/stackers/${when}`, query }) } const when = router.query.when || 'day' return (