import { useTranslations } from 'next-intl'; import { Button } from '@/components/ui/button'; import { Field, FieldError, FieldGroup, FieldLabel, } from '@/components/ui/field'; import { Input } from '@/components/ui/input'; import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import type { NodeStatus } from '@/lib/services/openflare'; export function NodeListControls({ search, searchTooLong, onSearchChange, status, onStatusChange, page, pageSize, onPageSizeChange, total, totalPages, loading, hasData, onPageChange, }: { search: string; searchTooLong: boolean; onSearchChange: (value: string) => void; status: NodeStatus | ''; onStatusChange: (value: NodeStatus | '') => void; page: number; pageSize: number; onPageSizeChange: (value: number) => void; total: number; totalPages: number; loading: boolean; hasData: boolean; onPageChange: (value: number) => void; }) { const t = useTranslations('nodes'); return (
{t('pagination.search')} onSearchChange(event.target.value)} placeholder={t('pagination.searchPlaceholder')} maxLength={256} aria-invalid={searchTooLong || undefined} aria-describedby={searchTooLong ? 'node-search-error' : undefined} /> {searchTooLong && ( {t('pagination.searchTooLong')} )} {t('table.status')} {t('pagination.pageSize')}
{hasData && (

{t('pagination.summary', { page, totalPages, total })}

)}
); }