import { TemporalFormat } from "@trackunit/date-and-time-utils"; import { CommonProps, Refable, type Styleable } from "@trackunit/react-components"; import { ReactElement } from "react"; export interface DateTimeCellProps extends CommonProps, Refable, Styleable { /** * The date to render. * If not provided, the component will not render. */ date?: Date; /** * If true, the component will render the time since the date. * This is rendered on a separate line. * * @default true */ withTimeSince?: boolean; /** * The format to use for the date. * If not provided, the component will use the default format. * See the formatDateUtil function for more information. */ format?: TemporalFormat; /** * Explicit timezone override (IANA timezone string, e.g. `"America/New_York"`). * When provided, takes precedence over the automatically resolved timezone from context. * * In most cases you do not need this — the component resolves the correct timezone * automatically via `AssetTimezoneProvider` and user preference context. */ timeZone?: string; /** * Explicit locale override (BCP 47 language tag, e.g. `"en-US"`). * When provided, takes precedence over the locale resolved from context. */ locale?: string; } /** * The `` component renders a formatted date/time in a table cell. * It displays the formatted date with an optional "time since" indicator * (e.g., "2 hours ago") on a second line for quick context. * * ### When to use * - Display timestamps, created/updated dates in tables * - When users need to quickly understand how recent an event was * - For date columns that benefit from relative time context * * ### When not to use * - For date-only display without time - use `PlainDateCell` instead * - For duration values - use `NumberCell` with appropriate units * - For editable date inputs - use form components instead * * @example Basic usage * ```tsx * import { DateTimeCell } from "@trackunit/react-table-base-components"; * import { createColumnHelper } from "@tanstack/react-table"; * * const columnHelper = createColumnHelper(); * * const columns = [ * columnHelper.accessor("createdAt", { * header: "Created", * cell: ({ getValue }) => , * }), * ]; * ``` * @example With timezone and format options * ```tsx * import { DateTimeCell } from "@trackunit/react-table-base-components"; * * // Default format with time since * * // Output: "Jan 15, 2024, 2:30 PM" + "3 days ago" * * // Without time since indicator * * * // With specific timezone * * * // Custom format * * ``` * @param {DateTimeCellProps} props - The props for the DateTimeCell component * @returns {ReactElement} DateTimeCell component */ export declare const DateTimeCell: ({ format, date, withTimeSince, className, "data-testid": dataTestId, style, timeZone: timeZoneProp, locale: localeProp, }: DateTimeCellProps) => ReactElement | null;