import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Tooltip, TooltipTrigger, TooltipContent, } from "../../components/ui/tooltip";
import { formatTime, formatDateTime } from "../utils";
export const TimeWithTooltip = ({ date, className, testId, timestampAttr, }) => {
    if (Number.isNaN(date.getTime()))
        return null;
    const cls = className ? `${className} cursor-help` : "cursor-help";
    return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { className: cls, "data-testid": testId, "data-timestamp": timestampAttr, children: formatTime(date) }) }), _jsx(TooltipContent, { side: "top", children: formatDateTime(date) })] }));
};
//# sourceMappingURL=TimeWithTooltip.js.map