import { CommonProps, Refable, type Styleable } from "@trackunit/react-components"; import { ReactElement, ReactNode } from "react"; export interface IdentityCellProps extends CommonProps, Refable, Styleable { className?: string; "data-testid"?: string; /** The main title or name to display */ title?: ReactNode; /** Array of detail strings to display below the title (e.g., model, brand, serial number) */ details?: Array; /** Optional thumbnail image or icon to display on the left side (e.g. asset image)*/ thumbnail?: ReactNode; /** Optional link configuration to make the title clickable */ link?: { href: () => Promise; goto: () => Promise; /** Accessible title/label for the link */ title?: string; }; } /** * The `` component renders an identity or entity in a table cell, * typically showing a title with optional thumbnail and supporting details. * Commonly used for displaying assets, users, or other entities with rich metadata. * * When displaying asset information, always use the `type` field * (e.g., "excavator", "boom lift") instead of `assetType` (e.g., "machine", "attachment"). * * ### When to use * - Display entities with name + additional identifying details (model, serial number, etc.) * - When a thumbnail/avatar helps users identify the item * - For the primary identifying column in asset, user, or entity tables * * ### When not to use * - For simple text values - use `TextCell` instead * - For numeric data - use `NumberCell` instead * - For standalone links without identity context - use `LinkCell` instead * * @example Basic usage with asset data * ```tsx * import { IdentityCell } from "@trackunit/react-table-base-components"; * import { createColumnHelper } from "@tanstack/react-table"; * * const columnHelper = createColumnHelper(); * * const columns = [ * columnHelper.accessor("name", { * header: "Asset", * cell: ({ row }) => ( * * ), * }), * ]; * ``` * @example With thumbnail and link * ```tsx * import { IdentityCell } from "@trackunit/react-table-base-components"; * import { AssetImage } from "@trackunit/react-components"; * import { useIrisRouting } from "@trackunit/react-core-contexts-and-hooks"; * * const { createHref, goto } = useIrisRouting(); * * } * link={{ * href: () => createHref({ page: "asset", assetId }), * goto: () => goto({ page: "asset", assetId }), * title: "View asset details", * }} * /> * ``` * @example Simple identity without extras * ```tsx * import { IdentityCell } from "@trackunit/react-table-base-components"; * * // Just title * * * // Title with details array * * ``` * @param {IdentityCellProps} props - The props for the IdentityCell component * @returns {ReactElement} IdentityCell component */ export declare const IdentityCell: ({ link, className, "data-testid": dataTestId, ref, style, title, details, thumbnail, }: IdentityCellProps) => ReactElement;