import React, { HTMLAttributes, forwardRef } from "react"; import { Detail, Heading, HeadingProps } from "../typography"; import { cl } from "../utils/helpers"; export interface ChatBubbleProps extends HTMLAttributes { /** * Bubble text. */ children: React.ReactNode; /** * Name/sender on bubble. */ name?: string; /** * Timestamp for sent message. */ timestamp?: string; /** * Overrides hoizontal position of toptext. */ toptextPosition?: "left" | "right"; /** * The heading level for the toptext. * @default "3" */ toptextHeadingLevel?: Exclude; } const Bubble = forwardRef( ( { children, className, name, timestamp, toptextPosition, toptextHeadingLevel = "3", ...rest }, ref, ) => { return (
{(timestamp || name) && ( {name && {name}} {name && timestamp && ( )} {timestamp && {timestamp}} )} {children}
); }, ); export default Bubble;