|
9 | 9 |
|
10 | 10 | import { SITE_NAME } from '@/lib/consts' |
11 | 11 | import type { Metadata, Route } from 'next' |
12 | | -import { LibrarySelector } from '@/components/dashboard/LibrarySelector' |
13 | 12 | import { DateRangeSelector } from '@/components/dashboard/DateRangeSelector' |
14 | 13 | import { IsLoggedIn } from '@/lib/firebase/firebase' |
15 | 14 | import { redirect, RedirectType } from 'next/navigation' |
@@ -78,17 +77,6 @@ export default async function DashboardPage({ |
78 | 77 | return <div>{libsRes.error}</div> |
79 | 78 | } |
80 | 79 |
|
81 | | - async function onLibraryChange(libraryID: string) { |
82 | | - 'use server' |
83 | | - |
84 | | - const p = await searchParams |
85 | | - // @ts-expect-error: skip and imit are not used now |
86 | | - const sp = new URLSearchParams(p) |
87 | | - sp.set('library_id', libraryID) |
88 | | - |
89 | | - redirect(('./?' + sp.toString()) as Route, RedirectType.replace) |
90 | | - } |
91 | | - |
92 | 80 | const fromDate = parse(from, 'dd-MM-yyyy', new Date()) |
93 | 81 | const toDate = parse(to, 'dd-MM-yyyy', new Date()) |
94 | 82 |
|
@@ -125,16 +113,8 @@ export default async function DashboardPage({ |
125 | 113 | </Breadcrumb> |
126 | 114 |
|
127 | 115 | <div className="grid my-4 grid-cols-1 gap-4 md:grid-cols-2"> |
128 | | - <LibrarySelector |
129 | | - libs={libsRes.data.filter((lib) => |
130 | | - claims.librarease.admin_libs |
131 | | - .concat(claims.librarease.staff_libs) |
132 | | - .includes(lib.id) |
133 | | - )} |
134 | | - lib={libID!} |
135 | | - onChangeAction={onLibraryChange} |
136 | | - /> |
137 | 116 | <DateRangeSelector |
| 117 | + className="col-span-2" |
138 | 118 | range={{ from: fromDate, to: toDate }} |
139 | 119 | onChangeAction={onDateRangeChange} |
140 | 120 | /> |
|
0 commit comments