@cossistant/next
Version:
Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.
54 lines (52 loc) • 2.16 kB
TypeScript
import * as React$1 from "react";
//#region ../react/src/primitives/timeline-item.d.ts
/**
* Metadata describing the origin of a timeline item and pre-parsed content that can
* be consumed by render-prop children.
*/
type TimelineItemRenderProps = {
isVisitor: boolean;
isAI: boolean;
isHuman: boolean;
timestamp: Date;
text: string | null;
senderType: "visitor" | "ai" | "human";
itemType: "message" | "event" | "identification";
};
/**
* Generic timeline item wrapper that adds accessibility attributes and resolves the
* sender type into convenient render props for custom layouts. Works with
* both MESSAGE and EVENT timeline item types.
*/
declare const TimelineItem: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
children?: React$1.ReactNode | ((props: TimelineItemRenderProps) => React$1.ReactNode);
asChild?: boolean;
className?: string;
item: TimelineItemType;
} & React$1.RefAttributes<HTMLDivElement>>;
/**
* Renders the content of a timeline item, optionally piping Markdown content through a
* memoised renderer or handing the raw text to a render prop for custom
* formatting.
*/
declare const TimelineItemContent: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
children?: React$1.ReactNode | ((content: string) => React$1.ReactNode);
asChild?: boolean;
className?: string;
text?: string | null;
renderMarkdown?: boolean;
} & React$1.RefAttributes<HTMLDivElement>>;
/**
* Timestamp helper that renders a formatted date or allows callers to supply a
* render prop for custom time displays while preserving semantic markup.
*/
declare const TimelineItemTimestamp: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> & {
children?: React$1.ReactNode | ((timestamp: Date) => React$1.ReactNode);
asChild?: boolean;
className?: string;
timestamp: Date;
format?: (date: Date) => string;
} & React$1.RefAttributes<HTMLSpanElement>>;
//#endregion
export { TimelineItem, TimelineItemContent, TimelineItemTimestamp };
//# sourceMappingURL=timeline-item.d.ts.map