diff --git a/modules/customers/src/web/_archived/pages/list/customers-list-grid.tsx b/modules/customers/src/web/_archived/pages/list/customers-list-grid.tsx deleted file mode 100644 index f7466129..00000000 --- a/modules/customers/src/web/_archived/pages/list/customers-list-grid.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import { SimpleSearchInput } from "@erp/core/components"; -import { DataTable, SkeletonDataTable } from "@repo/rdx-ui/components"; -import { useCallback, useState } from "react"; -import { useNavigate } from "react-router-dom"; - -import { useTranslation } from "../../../i18n"; -import type { CustomerSummaryFormData, CustomersPageFormData } from "../../schemas"; - -import { useCustomersListColumns } from "./use-customers-list-columns"; - -export type CustomerUpdateCompProps = { - customersPage: CustomersPageFormData; - loading?: boolean; - - pageIndex: number; - pageSize: number; - onPageChange?: (pageNumber: number) => void; - onPageSizeChange?: (pageSize: number) => void; - - searchValue: string; - onSearchChange: (value: string) => void; - - onRowClick?: ( - row: CustomerSummaryFormData, - index: number, - event: React.MouseEvent - ) => void; -}; - -export const CustomersListGrid = ({ - customersPage, - loading, - pageIndex, - pageSize, - onPageChange, - onPageSizeChange, - searchValue, - onSearchChange, - onRowClick, -}: CustomerUpdateCompProps) => { - const { t } = useTranslation(); - const navigate = useNavigate(); - const { items, total_items } = customersPage; - - const [statusFilter, setStatusFilter] = useState("todas"); - - const columns = useCustomersListColumns({ - onEdit: (customer) => navigate(`/customers/${customer.id}/edit`), - onView: (customer) => navigate(`/customers/${customer.id}`), - onDelete: (customer) => null, //confirmDelete(inv.id), - }); - - // Navegación centralizada (click/teclado) - const goToRow = useCallback( - (id: string, newTab = false) => { - const url = `/customers/${id}`; - if (newTab) { - window.open(url, "_blank", "noopener,noreferrer"); - } else { - navigate(url); - } - }, - [navigate] - ); - - // Handlers de búsqueda - const handleInputChange = (e: React.ChangeEvent) => - onSearchChange(e.target.value); - const handleClear = () => onSearchChange(""); - const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Enter") { - // Envío inmediato: forzar “salto” del debounce - onSearchChange((e.target as HTMLInputElement).value); - } - }; - - /*const handleRowClick = useCallback( - (customer: CustomerSummaryFormData, _i: number, e: React.MouseEvent) => { - const url = `/customer-invoices/${customer.id}/edit`; - if (e.metaKey || e.ctrlKey) { window.open(url, "_blank", "noopener,noreferrer"); return; } - preview.open(customer); - }, - [preview] - );*/ - - if (loading) { - return ( -
- -
- ); - } - - // Render principal - return ( -
- {/* Barra de filtros */} -
- -
-
-
- null /*handleRowClick*/} - pageIndex={pageIndex} - pageSize={pageSize} - readOnly - totalItems={total_items} - /> -
- - {/* - {({ item, isPinned, close, togglePin }) => ( - - )} - */} -
-
- ); -}; diff --git a/modules/customers/src/web/_archived/pages/list/index.ts b/modules/customers/src/web/_archived/pages/list/index.ts deleted file mode 100644 index 08d76a73..00000000 --- a/modules/customers/src/web/_archived/pages/list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "../../../list/ui/pages/list-customers-page";