Revisar listado de clients

This commit is contained in:
David Arranz 2026-08-06 13:50:06 +02:00
parent a7543497b0
commit d0779e2875
3 changed files with 20 additions and 1 deletions

View File

@ -71,6 +71,9 @@ export function useCustomersGridColumns(
enableHiding: false,
size: 140,
minSize: 120,
meta: {
title: t("list.columns.customer"),
},
cell: ({ row }) => {
const customer = row.original;
@ -131,6 +134,9 @@ export function useCustomersGridColumns(
enableSorting: false,
size: 140,
minSize: 120,
meta: {
title: t("list.columns.contact"),
},
cell: ({ row }) => <ContactCell contact={row.original.contact} />,
},
{
@ -147,12 +153,16 @@ export function useCustomersGridColumns(
enableSorting: false,
size: 140,
minSize: 120,
meta: {
title: t("list.columns.address"),
},
cell: ({ row }) => <AddressCell address={row.original.address} />,
},
{
id: "actions",
meta: {
isActionsColumn: true,
title: t("common.actions"),
headerClassName: "text-right",
},
header: "Acciones",

View File

@ -1,3 +1,4 @@
import { EmptyCellValue } from "@erp/core/components";
import { ExternalLinkIcon, MapPinIcon } from "lucide-react";
import { useTranslation } from "../../../i18n";
@ -37,6 +38,11 @@ export const AddressCell = ({ address }: { address: CustomerAddress }) => {
const line2 = join([address.postalCode, address.city], " ");
const line3 = join([address.province, address.country], ", ");
const line23 = join([line2, line3], " - ");
const hasAddress = Boolean(line1 || line23);
if (!hasAddress) {
return <EmptyCellValue />;
}
return (
<address className="not-italic flex items-start gap-2 text-muted-foreground hover:text-primary transition-colors">

View File

@ -1,3 +1,4 @@
import { EmptyCellValue } from "@erp/core/components";
import { GlobeIcon, MailIcon, PhoneIcon, PrinterIcon, SmartphoneIcon } from "lucide-react";
interface ContactCellData {
@ -66,7 +67,9 @@ export const ContactCell = ({ contact }: { contact: ContactCellData }) => {
: []),
];
if (items.length === 0) return null;
if (items.length === 0) {
return <EmptyCellValue />;
}
return (
<div className="flex flex-col gap-1.5 text-sm text-muted-foreground transition-colors">