.
This commit is contained in:
parent
2010eab897
commit
67ef358866
19
modules/core/src/web/components/empty-cell-value.tsx
Normal file
19
modules/core/src/web/components/empty-cell-value.tsx
Normal 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>
|
||||
);
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
export * from "./empty-cell-value";
|
||||
export * from "./error-alert";
|
||||
export * from "./error-state";
|
||||
export * from "./form";
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user