Path: blob/master/src/packages/frontend/chat/time.tsx
1496 views
import { TimeAgo } from "@cocalc/frontend/components";1import { IS_TOUCH } from "@cocalc/frontend/feature";2import { ChatMessageTyped } from "./types";34interface Props {5message: ChatMessageTyped;6edit: (event) => void;7}89export function Time({ message, edit }: Props) {10// We make click on the timestamp edit the chat since onDoubleClick is completely11// ignored on mobile touch devices...12return (13<span14onClick={IS_TOUCH && edit != null ? edit : undefined}15className="pull-right small"16style={{17maxWidth: "20%",18whiteSpace: "nowrap",19overflow: "hidden",20textOverflow: "ellipsis",21cursor: "pointer",22}}23>24<TimeAgo date={new Date(message.get("date"))} />25</span>26);27}282930