feat: add file upload and management features; enhance pagination and permissions handling
This commit is contained in:
@@ -5,6 +5,7 @@ import { useCallback } from 'react';
|
||||
import { useRouter, useSearchParams, usePathname } from 'next/navigation';
|
||||
|
||||
import { Search } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
import { Button } from '../shadcn/button';
|
||||
import { Input } from '../shadcn/input';
|
||||
@@ -40,11 +41,13 @@ interface ListToolbarProps {
|
||||
* Resets to page 1 on any filter/search change.
|
||||
*/
|
||||
export function ListToolbar({
|
||||
searchPlaceholder = 'Suchen...',
|
||||
searchPlaceholder,
|
||||
searchParam = 'q',
|
||||
filters = [],
|
||||
showSearch = true,
|
||||
}: ListToolbarProps) {
|
||||
const t = useTranslations('common');
|
||||
const resolvedPlaceholder = searchPlaceholder ?? t('searchPlaceholder');
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
@@ -84,12 +87,12 @@ export function ListToolbar({
|
||||
name="search"
|
||||
type="search"
|
||||
defaultValue={currentSearch}
|
||||
placeholder={searchPlaceholder}
|
||||
placeholder={resolvedPlaceholder}
|
||||
className="w-64"
|
||||
/>
|
||||
<Button type="submit" variant="outline" size="sm">
|
||||
<Search className="mr-1 h-4 w-4" />
|
||||
Suchen
|
||||
{t('search')}
|
||||
</Button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user