UNPKG

@hitachivantara/uikit-react-core

Version:

Core React components for the NEXT Design System.

23 lines (22 loc) 836 B
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const jsxRuntime = require("react/jsx-runtime"); const React = require("react"); const dayjs = require("dayjs"); const OverflowTooltip = require("../../OverflowTooltip/OverflowTooltip.cjs"); const _interopDefault = (e) => e && e.__esModule ? e : { default: e }; const dayjs__default = /* @__PURE__ */ _interopDefault(dayjs); const HvDateColumnCell = ({ date, dateFormat }) => { const formattedDate = React.useMemo(() => { if (date) return dayjs__default.default(date).format( dateFormat !== "ISO8601" ? dateFormat : void 0 ); return "—"; }, [date, dateFormat]); return /* @__PURE__ */ jsxRuntime.jsx(OverflowTooltip.HvOverflowTooltip, { data: formattedDate }); }; exports.HvDateColumnCell = HvDateColumnCell;