stacker.news/components/usage-header.js

24 lines
585 B
JavaScript
Raw Normal View History

2022-06-24 15:38:00 +00:00
import { useRouter } from 'next/router'
import { Select } from './form'
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 (
<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
)
}