Revisar listado de clients
This commit is contained in:
parent
a7543497b0
commit
d0779e2875
@ -71,6 +71,9 @@ export function useCustomersGridColumns(
|
|||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
size: 140,
|
size: 140,
|
||||||
minSize: 120,
|
minSize: 120,
|
||||||
|
meta: {
|
||||||
|
title: t("list.columns.customer"),
|
||||||
|
},
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const customer = row.original;
|
const customer = row.original;
|
||||||
|
|
||||||
@ -131,6 +134,9 @@ export function useCustomersGridColumns(
|
|||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
size: 140,
|
size: 140,
|
||||||
minSize: 120,
|
minSize: 120,
|
||||||
|
meta: {
|
||||||
|
title: t("list.columns.contact"),
|
||||||
|
},
|
||||||
cell: ({ row }) => <ContactCell contact={row.original.contact} />,
|
cell: ({ row }) => <ContactCell contact={row.original.contact} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -147,12 +153,16 @@ export function useCustomersGridColumns(
|
|||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
size: 140,
|
size: 140,
|
||||||
minSize: 120,
|
minSize: 120,
|
||||||
|
meta: {
|
||||||
|
title: t("list.columns.address"),
|
||||||
|
},
|
||||||
cell: ({ row }) => <AddressCell address={row.original.address} />,
|
cell: ({ row }) => <AddressCell address={row.original.address} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "actions",
|
id: "actions",
|
||||||
meta: {
|
meta: {
|
||||||
isActionsColumn: true,
|
isActionsColumn: true,
|
||||||
|
title: t("common.actions"),
|
||||||
headerClassName: "text-right",
|
headerClassName: "text-right",
|
||||||
},
|
},
|
||||||
header: "Acciones",
|
header: "Acciones",
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { EmptyCellValue } from "@erp/core/components";
|
||||||
import { ExternalLinkIcon, MapPinIcon } from "lucide-react";
|
import { ExternalLinkIcon, MapPinIcon } from "lucide-react";
|
||||||
|
|
||||||
import { useTranslation } from "../../../i18n";
|
import { useTranslation } from "../../../i18n";
|
||||||
@ -37,6 +38,11 @@ export const AddressCell = ({ address }: { address: CustomerAddress }) => {
|
|||||||
const line2 = join([address.postalCode, address.city], " ");
|
const line2 = join([address.postalCode, address.city], " ");
|
||||||
const line3 = join([address.province, address.country], ", ");
|
const line3 = join([address.province, address.country], ", ");
|
||||||
const line23 = join([line2, line3], " - ");
|
const line23 = join([line2, line3], " - ");
|
||||||
|
const hasAddress = Boolean(line1 || line23);
|
||||||
|
|
||||||
|
if (!hasAddress) {
|
||||||
|
return <EmptyCellValue />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<address className="not-italic flex items-start gap-2 text-muted-foreground hover:text-primary transition-colors">
|
<address className="not-italic flex items-start gap-2 text-muted-foreground hover:text-primary transition-colors">
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { EmptyCellValue } from "@erp/core/components";
|
||||||
import { GlobeIcon, MailIcon, PhoneIcon, PrinterIcon, SmartphoneIcon } from "lucide-react";
|
import { GlobeIcon, MailIcon, PhoneIcon, PrinterIcon, SmartphoneIcon } from "lucide-react";
|
||||||
|
|
||||||
interface ContactCellData {
|
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 (
|
return (
|
||||||
<div className="flex flex-col gap-1.5 text-sm text-muted-foreground transition-colors">
|
<div className="flex flex-col gap-1.5 text-sm text-muted-foreground transition-colors">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user