This commit is contained in:
David Arranz 2026-07-30 14:49:10 +02:00
parent 2010eab897
commit 67ef358866
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,19 @@
import { cn } from "@repo/shadcn-ui/lib/utils";
type EmptyCellValueProps = {
className?: string;
value?: string;
};
export const EmptyCellValue = ({
className,
value = "\u2014",
}: EmptyCellValueProps) => (
<span
aria-label="Sin valor"
className={cn("inline-flex items-center text-muted-foreground", className)}
>
{value}
</span>
);

View File

@ -1,3 +1,4 @@
export * from "./empty-cell-value";
export * from "./error-alert";
export * from "./error-state";
export * from "./form";

View File

@ -1,3 +1,4 @@
import { EmptyCellValue } from "@erp/core/components";
import { DataTableColumnHeader } from "@repo/rdx-ui/components";
import { DateHelper } from "@repo/rdx-utils";
import {
@ -195,6 +196,7 @@ export function useProformasGridColumns(
header: "Serie",
enableHiding: true,
enableSorting: false,
cell: ({ row }) => row.original.series || <EmptyCellValue />,
},
{
id: "reference",
@ -207,7 +209,12 @@ export function useProformasGridColumns(
title={t("pages.proformas.list.columns.reference")}
/>
),
cell: ({ row }) => <div className="truncate">{row.original.reference}</div>,
cell: ({ row }) =>
row.original.reference ? (
<div className="truncate">{row.original.reference}</div>
) : (
<EmptyCellValue />
),
meta: {
cellClassName: "hidden lg:table-cell max-w-16",
headerClassName: "hidden lg:table-cell",