feat(results-page): enhance search with caching, pagination, and UI tweaks

- Add dynamic rendering and Node.js runtime config to location API for better performance
- Improve ProductCardSkeleton with dark mode styling for consistent theming
- Simplify Hero search placeholder to focus on product name input
- Integrate caching, pagination, and cache clearing in results page for optimized search experience and user control
This commit is contained in:
Evandro Fonseca Junior committed 2025-10-09 01:53:42 -03:00
1 parent 166abeb64e
commit e4ed666074
11 files changed
+1301 -86

No files matched your search

+44
View File
@@ -288,3 +288,47 @@ export const COMMON_ADDITIVES = [
"stabilizers",
"thickeners",
];
// Tipos para sistema de cache e paginação
export interface PaginationState {
currentPage: number;
totalPages: number;
itemsPerPage: number;
totalItems: number;
startIndex: number;
endIndex: number;
}
export interface PaginationConfig {
itemsPerPage: number;
maxVisiblePages: number;
showFirstLast: boolean;
showPrevNext: boolean;
}
export interface CacheProgress {
currentPage: number;
totalPages: number;
loadedProducts: number;
totalProducts: number;
isLoading: boolean;
error?: string;
}
export interface SearchCacheConfig {
ttl: number; // Time to live em milissegundos
maxSize: number; // Tamanho máximo em bytes
maxEntries: number; // Número máximo de entradas
enableCompression: boolean; // Se deve comprimir dados
}
export interface PaginationProps {
currentPage: number;
totalPages: number;
totalItems: number;
itemsPerPage: number;
onPageChange: (page: number) => void;
onItemsPerPageChange?: (itemsPerPage: number) => void;
config?: Partial<PaginationConfig>;
className?: string;
}