mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-31 14:12:37 +08:00
[portal][ui] add MonthYearPicker
This commit is contained in:
@ -1,11 +1,18 @@
|
||||
import { useState } from 'react';
|
||||
import type { TypeaheadOption } from '@tih/ui';
|
||||
import { HorizontalDivider } from '@tih/ui';
|
||||
|
||||
import CompaniesTypeahead from '~/components/global/CompaniesTypeahead';
|
||||
import CompaniesTypeahead from '~/components/shared/CompaniesTypeahead';
|
||||
import type { MonthYear } from '~/components/shared/MonthYearPicker';
|
||||
import MonthYearPicker from '~/components/shared/MonthYearPicker';
|
||||
|
||||
export default function HomePage() {
|
||||
const [selectedCompany, setSelectedCompany] =
|
||||
useState<TypeaheadOption | null>(null);
|
||||
const [monthYear, setMonthYear] = useState<MonthYear>({
|
||||
month: new Date().getMonth() + 1,
|
||||
year: new Date().getFullYear(),
|
||||
});
|
||||
|
||||
return (
|
||||
<main className="flex-1 overflow-y-auto">
|
||||
@ -18,6 +25,8 @@ export default function HomePage() {
|
||||
onSelect={(option) => setSelectedCompany(option)}
|
||||
/>
|
||||
<pre>{JSON.stringify(selectedCompany, null, 2)}</pre>
|
||||
<HorizontalDivider />
|
||||
<MonthYearPicker value={monthYear} onChange={setMonthYear} />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
Reference in New Issue
Block a user