2022-06-24 15:38:00 +00:00
|
|
|
import { useRouter } from 'next/router'
|
2023-07-25 20:29:45 +00:00
|
|
|
import { Select } from './form'
|
2023-07-23 15:08:43 +00:00
|
|
|
import { WHENS } from '../lib/constants'
|
2022-06-24 15:38:00 +00:00
|
|
|
|
|
|
|
export function UsageHeader () {
|
|
|
|
const router = useRouter()
|
2022-12-01 21:31:04 +00:00
|
|
|
|
2022-06-24 15:38:00 +00:00
|
|
|
return (
|
2023-07-25 20:29:45 +00:00
|
|
|
<div className='text-muted fw-bold my-3 d-flex align-items-center'>
|
|
|
|
stacker analytics for
|
|
|
|
<Select
|
|
|
|
groupClassName='mb-0 ms-2'
|
|
|
|
className='w-auto'
|
|
|
|
name='when'
|
|
|
|
size='sm'
|
|
|
|
items={WHENS}
|
|
|
|
value={router.query.when || 'day'}
|
|
|
|
noForm
|
|
|
|
onChange={(formik, e) => router.push(`/stackers/${e.target.value}`)}
|
|
|
|
/>
|
|
|
|
</div>
|
2022-06-24 15:38:00 +00:00
|
|
|
)
|
|
|
|
}
|