-
+
+
+
{" "}
- {customer.name}
+ {customer.name}
{customer.trade_name && ({customer.trade_name})}
@@ -105,22 +104,22 @@ export function useCustomersGridColumns(
},
// Contacto (emails, teléfonos, web)
- {
- id: "contact",
- header: ({ column }) => (
-
- ),
- accessorFn: (r) => `${r.email_primary} ${r.phone_primary} ${r.mobile_primary} ${r.website}`,
- size: 140,
- minSize: 120,
- cell: ({ row }) => ,
- },
+ {
+ id: "contact",
+ header: ({ column }) => (
+
+ ),
+ accessorFn: (r) => `${r.email_primary} ${r.phone_primary} ${r.mobile_primary} ${r.website}`,
+ size: 140,
+ minSize: 120,
+ cell: ({ row }) => ,
+ },
- // Dirección (múltiples campos en bloque)
+ // Dirección (múltiples campos en bloque)
{
id: "address",
header: t("pages.list.grid_columns.address"),
@@ -159,37 +158,37 @@ export function useCustomersGridColumns(
- {0 === false && (
-
-
-
-
-
- Actions
-
- actionHandlers.onViewClick?.(customer)}>Open
- actionHandlers.onEditClick?.(customer)}>Edit
-
- window.open(safeHttp(website), "_blank")}>
- Visit website
-
- navigator.clipboard.writeText(email_primary)}
- >
- Copy email
-
-
- actionHandlers.onDeleteClick?.(customer)}
- >
- Delete
-
-
-
- )}
+
+
+
+
+
+ Actions
+
+ actionHandlers.onViewClick?.(customer)}>
+ Open
+
+ actionHandlers.onEditClick?.(customer)}>
+ Edit
+
+
+ window.open(safeHttp(website), "_blank")}>
+ Visit website
+
+ navigator.clipboard.writeText(email_primary)}>
+ Copy email
+
+
+ actionHandlers.onDeleteClick?.(customer)}
+ >
+ Delete
+
+
+
);
diff --git a/modules/customers/src/web/list/ui/components/address-cell.tsx b/modules/customers/src/web/list/ui/components/address-cell.tsx
index 8e713f17..9125ed2a 100644
--- a/modules/customers/src/web/list/ui/components/address-cell.tsx
+++ b/modules/customers/src/web/list/ui/components/address-cell.tsx
@@ -1,11 +1,8 @@
-import {
- type CustomerSummaryData,
-} from "../../../types";
+import type { CustomerSummaryData } from "../../types";
-import { Soft } from './soft';
+import { Soft } from "./soft";
-
-export const AddressCell = ({ customer }: { customer: CustomerSummaryData; }) => {
+export const AddressCell = ({ customer }: { customer: CustomerSummaryData }) => {
const line1 = [customer.street, customer.street2].filter(Boolean).join(", ");
const line2 = [customer.postal_code, customer.city].filter(Boolean).join(" ");
const line3 = [customer.province, customer.country].filter(Boolean).join(", ");
diff --git a/modules/customers/src/web/list/ui/components/contact-cell.tsx b/modules/customers/src/web/list/ui/components/contact-cell.tsx
index 3c719a70..ae8e8627 100644
--- a/modules/customers/src/web/list/ui/components/contact-cell.tsx
+++ b/modules/customers/src/web/list/ui/components/contact-cell.tsx
@@ -1,9 +1,8 @@
-import { MailIcon, PhoneIcon } from 'lucide-react';
-import { Soft } from './soft';
-import {
- type CustomerSummaryData,
-} from "../../../types";
+import { MailIcon, PhoneIcon } from "lucide-react";
+import type { CustomerSummaryData } from "../../types";
+
+import { Soft } from "./soft";
export const ContactCell = ({ customer }: { customer: CustomerSummaryData }) => (
@@ -32,4 +31,4 @@ export const ContactCell = ({ customer }: { customer: CustomerSummaryData }) =>
{false}
-);
\ No newline at end of file
+);
diff --git a/modules/customers/src/web/list/ui/pages/customer-list-page.tsx b/modules/customers/src/web/list/ui/pages/customer-list-page.tsx
index ae364c5e..9db16236 100644
--- a/modules/customers/src/web/list/ui/pages/customer-list-page.tsx
+++ b/modules/customers/src/web/list/ui/pages/customer-list-page.tsx
@@ -1,10 +1,13 @@
+import { PageHeader, SimpleSearchInput } from "@erp/core/components";
+import { AppContent, AppHeader, BackHistoryButton } from "@repo/rdx-ui/components";
+import { Button } from "@repo/shadcn-ui/components";
+import { PlusIcon } from "lucide-react";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "../../../i18n";
-import { useCustomerListPageController } from '../../controllers';
-import { useCustomersGridColumns } from '../blocks';
-import { AppContent, BackHistoryButton } from '@repo/rdx-ui/components';
-import { ErrorAlert } from '../../../ui';
+import { ErrorAlert } from "../../../ui";
+import { useCustomerListPageController } from "../../controllers";
+import { CustomersGrid, useCustomersGridColumns } from "../blocks";
export const CustomerListPage = () => {
const { t } = useTranslation();
@@ -12,9 +15,11 @@ export const CustomerListPage = () => {
const { listCtrl } = useCustomerListPageController();
- const columns = useCustomersGridColumns({});
-
-
+ const columns = useCustomersGridColumns({
+ onEditClick: (customer) => navigate(`/customers/${customer.id}/edit`),
+ onViewClick: (customer) => navigate(`/customers/${customer.id}`),
+ onDeleteClick: (customer) => null, //confirmDelete(inv.id),
+ });
if (listCtrl.isError || !listCtrl.data) {
return (
@@ -26,10 +31,8 @@ export const CustomerListPage = () => {